From f512f47b02d9486df4be09b2cee95c494a021b58 Mon Sep 17 00:00:00 2001 From: koennecke Date: Mon, 10 Mar 2008 11:06:07 +0000 Subject: [PATCH] - Refactored hdb callbacks SKIPPED: psi/julcho.c --- conman.c | 2 +- genericcontroller.c | 61 ++-- hipadaba.c | 446 ++++++++++--------------- hipadaba.h | 131 +++++--- logsetup.c | 31 +- make_gen | 2 +- ofac.c | 2 +- savehdb.c | 15 +- scriptcontext.c | 88 ++++- sicshdbadapter.c | 91 +++-- sicshipadaba.c | 588 ++++++++++++++++++++++----------- sicshipadaba.h | 21 ++ sicsobj.c | 2 +- val.lis | 789 +++++++++++++++++++++++++++++++------------- 14 files changed, 1440 insertions(+), 829 deletions(-) diff --git a/conman.c b/conman.c index 0cc27db8..c4dc7b4b 100644 --- a/conman.c +++ b/conman.c @@ -410,7 +410,7 @@ extern pServer pServ; root = GetHipadabaRoot(); if(root != NULL) { - InternalRemoveHipadabaCallback(root,pVictim); + RemoveConnectionCallbacks(root,pVictim); } /* diff --git a/genericcontroller.c b/genericcontroller.c index 7aecd6e8..7e8f0378 100644 --- a/genericcontroller.c +++ b/genericcontroller.c @@ -16,19 +16,25 @@ #include #include /*--------------------------------------------------------------------------*/ -static int GenConSetCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn GenConSetCallback(pHdb node, void *userData, + pHdbMessage message){ pSICSOBJ self = (pSICSOBJ)userData; - SConnection *pCon = (SConnection *)callData; + SConnection *pCon = NULL; pGenController priv = NULL; char command[1024]; char value[80]; int status, privilege; pDynString data; + pHdbDataMessage mm = NULL; assert(self != NULL); + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } + priv = (pGenController)self->pPrivate; + pCon = mm->callData; /* * check rights @@ -43,7 +49,7 @@ static int GenConSetCallback(void *userData, void *callData, pHdb node, privilege = usUser; } if(!SCMatchRights(pCon,privilege)){ - return 0; + return hdbAbort; } } @@ -55,9 +61,9 @@ static int GenConSetCallback(void *userData, void *callData, pHdb node, if(strlen(value) < 2){ if(pCon != NULL){ SCWrite(pCon,"ERROR: parameter is read-only",eError); - return 0; + return hdbAbort; } - return 0; + return hdbAbort; } /* @@ -66,10 +72,10 @@ static int GenConSetCallback(void *userData, void *callData, pHdb node, memset(value,0,80); GetHdbProperty(node,"status",value,80); if(strstr(value,"idle") == NULL){ - return 0; + return hdbAbort; } SetHdbProperty(node,"status","setting"); - data = formatValue(v, node); + data = formatValue(*(mm->v), node); if(data != NULL){ SetHdbProperty(node,"target",GetCharArray(data)); DeleteDynString(data); @@ -85,23 +91,29 @@ static int GenConSetCallback(void *userData, void *callData, pHdb node, SCWrite(pCon,"ERROR: generic controller NOT configured", eError); } - return 0; + return hdbAbort; } - return 1; + return hdbContinue; } /*--------------------------------------------------------------------------*/ -static int GenConGetCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn GenConGetCallback(pHdb node, void *userData, + pHdbMessage message){ pSICSOBJ self = (pSICSOBJ)userData; - SConnection *pCon = (SConnection *)callData; + SConnection *pCon = NULL; pGenController priv = NULL; char command[1024]; char value[256]; int status, privilege; + pHdbDataMessage mm = NULL; assert(self != NULL); + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } + pCon = mm->callData; + priv = (pGenController)self->pPrivate; /* @@ -110,7 +122,7 @@ static int GenConGetCallback(void *userData, void *callData, pHdb node, memset(value,0,80); GetHdbProperty(node,"status",value,80); if(strstr(value,"idle") == NULL){ - return 1; + return hdbContinue; } SetHdbProperty(node,"status","getting"); @@ -120,7 +132,7 @@ static int GenConGetCallback(void *userData, void *callData, pHdb node, memset(value,0,256); GetHdbProperty(node,"readCommand",value,255); if(strlen(value) < 2){ - return 0; + return hdbAbort; } else { if(priv->enqueueNode != NULL){ priv->enqueueNode(self,pCon, node); @@ -129,17 +141,17 @@ static int GenConGetCallback(void *userData, void *callData, pHdb node, SCWrite(pCon,"ERROR: generic controller connection NOT configured", eError); } - return 0; + return hdbAbort; } } /* - * Upper Level GetHipadabaPar will automtaically return the + * Upper Level GetHipadabaPar will automatically return the * node value. Which should have been updated through an update * during the execution of enqueueNode */ - return 1; + return hdbContinue; } /*---------------------------------------------------------------------------*/ static pHdb MakeGenConPar(pSICSOBJ self, char *name, int type, int length){ @@ -153,23 +165,20 @@ static pHdb MakeGenConPar(pSICSOBJ self, char *name, int type, int length){ kalle = MakeHipadabaCallback(GenConSetCallback, self, - NULL, - -1, NULL); if(kalle == NULL){ return NULL; } - AppendHipadabaCallback(result,HCBSET, kalle); + AppendHipadabaCallback(result,kalle); kalle = MakeHipadabaCallback(GenConGetCallback, self, - NULL, - -1, NULL); + if(kalle == NULL){ return NULL; } - AppendHipadabaCallback(result,HCBREAD, kalle); + AppendHipadabaCallback(result,kalle); SetHdbProperty(result,"priv","manager"); SetHdbProperty(result,"readCommand",""); @@ -587,13 +596,13 @@ int GenControllerFactory(SConnection *pCon, SicsInterp *pSics, funcValue = makeHdbData(HIPFUNC,1,EnqueFunc); node = MakeSICSHdbPar("enqueue",usUser, funcValue); AddSICSHdbPar(node,"node",usUser,textValue); - AppendHipadabaCallback(node,HCBSET,MakeSICSFuncCallback(pNew)); + AppendHipadabaCallback(node,MakeSICSFuncCallback(pNew)); AddHipadabaChild(pNew->objectNode,node,NULL); funcValue = makeHdbData(HIPFUNC,1,EnqueHeadFunc); node = MakeSICSHdbPar("enqueuehead",usUser, funcValue); AddSICSHdbPar(node,"node",usUser,textValue); - AppendHipadabaCallback(node,HCBSET,MakeSICSFuncCallback(pNew)); + AppendHipadabaCallback(node,MakeSICSFuncCallback(pNew)); AddHipadabaChild(pNew->objectNode,node,NULL); status = AddCommand(pSics, diff --git a/hipadaba.c b/hipadaba.c index 49192d34..0de04f67 100644 --- a/hipadaba.c +++ b/hipadaba.c @@ -14,6 +14,47 @@ #define ABS(x) (x < 0 ? -(x) : (x)) #define HDBMAGICK 77119900 +/*================== Message Stuff ========================================*/ +static char set[] = {"set"}; +static char get[] = {"get"}; +static char update[] = {"update"}; +static char treeChange[] = {"treeChange"}; +static char dataSearch[] = {"dataSearch"}; +/*------------------------------------------------------------------------*/ +pHdbDataMessage GetHdbSetMessage(pHdbMessage toTest){ + if(toTest->type == set){ + return (pHdbDataMessage)toTest; + } + return NULL; +} +/*------------------------------------------------------------------------*/ +pHdbDataMessage GetHdbGetMessage(pHdbMessage toTest){ + if(toTest->type == get){ + return (pHdbDataMessage)toTest; + } + return NULL; +} +/*------------------------------------------------------------------------*/ +pHdbDataMessage GetHdbUpdateMessage(pHdbMessage toTest){ + if(toTest->type == update){ + return (pHdbDataMessage)toTest; + } + return NULL; +} +/*-------------------------------------------------------------------------*/ +pHdbTreeChangeMessage GetHdbTreeChangeMessage(pHdbMessage toTest){ + if(toTest->type == treeChange){ + return (pHdbTreeChangeMessage)toTest; + } + return NULL; +} +/*-------------------------------------------------------------------------*/ +pHdbDataSearch GetHdbDataSearchMessage(pHdbMessage toTest){ + if(toTest->type == dataSearch){ + return (pHdbDataSearch)toTest; + } + return NULL; +} /*================== internal functions ===================================*/ void DeleteCallbackChain(pHdbCallback root){ pHdbCallback current = NULL, thisEntry; @@ -28,6 +69,17 @@ void DeleteCallbackChain(pHdbCallback root){ free(thisEntry); } } +/*----------------------------------------------------------------------*/ +void RecurseCallbackChains(pHdb node, pHdbMessage message){ + pHdb current = NULL; + + InvokeCallbackChain(node,message); + current = node->child; + while(current != NULL){ + RecurseCallbackChains(current,message); + current = current->next; + } +} /*-----------------------------------------------------------------------*/ void DeleteNodeData(pHdb node){ pHdb tmp = NULL; @@ -35,10 +87,7 @@ void DeleteNodeData(pHdb node){ if(node == NULL){ return; } - DeleteCallbackChain(node->writeCallbacks); - DeleteCallbackChain(node->updateCallbacks); - DeleteCallbackChain(node->readCallbacks); - DeleteCallbackChain(node->treeChangeCallbacks); + DeleteCallbackChain(node->callBackChain); if(node->properties != NULL){ DeleteStringDict(node->properties); } @@ -56,26 +105,83 @@ void DeleteNodeData(pHdb node){ } free(node); } +/*------------------------------------------------------------------------*/ +static pHdbCallback CleanCallbackChain(pHdbCallback chain){ + pHdbCallback head = chain; + pHdbCallback current = chain; + pHdbCallback next; + + while(current != NULL){ + if(current->killFlag == 1){ + next = current->next; + if(current == head){ + head = next; + } + /* + * unlink + */ + if(next != NULL){ + next->previous = current->previous; + } + if(current->previous != NULL){ + current->previous->next = next; + } + /* + * delete + */ + if(current->killFunc != NULL){ + current->killFunc(current->userData); + } + free(current); + /* + * move on + */ + current = next; + } else { + current = current->next; + } + } + + return head; +} /*-------------------------------------------------------------------------*/ -int InvokeCallbackChain(pHdbCallback root, pHdb node, - void *callData, hdbValue v){ - pHdbCallback current = root; - int status; +int InvokeCallbackChain(pHdb node, pHdbMessage message){ + pHdbCallback current = node->callBackChain; + hdbCallbackReturn status; + int killFlag = 0; while(current != NULL){ - status = current->userCallback(current->userData,callData, - node,v); - if(status != 1){ - return status; + status = current->userCallback(node, current->userData,message); + switch(status){ + case hdbAbort: + return 0; + break; + case hdbKill: + current->killFlag = 1; + killFlag = 1; + break; + case hdbContinue: + break; } current = current->next; } + if(killFlag == 1){ + node->callBackChain = CleanCallbackChain(node->callBackChain); + } return 1; -} +} +/*-----------------------------------------------------------------------*/ +static void SendTreeChangeMessage(pHdb node, void *callData){ + hdbTreeChangeMessage treeChangeMes; + treeChangeMes.type = treeChange; + treeChangeMes.callData = callData; + InvokeCallbackChain(node, (pHdbMessage)&treeChangeMes); +} /*------------------------------------------------------------------------*/ void RemoveHdbNodeFromParent(pHdb node, void *callData){ pHdb parent = NULL; pHdb current = NULL; + hdbTreeChangeMessage treeChangeMes; parent = node->mama; if(parent != NULL){ @@ -88,8 +194,7 @@ void RemoveHdbNodeFromParent(pHdb node, void *callData){ } current->next = current->next->next; } - InvokeCallbackChain(parent->treeChangeCallbacks, - parent,callData,parent->value); + SendTreeChangeMessage(parent,callData); node->mama = NULL; } } @@ -117,97 +222,6 @@ static void RemoveCallbackNode(pHdbCallback victim){ } free(victim); } -/*----------------------------------------------------------------------- - * This code is ugly: the problem is fixing up the start of the chain. - * Think about it and improve - * ----------------------------------------------------------------------*/ -static pHdbCallback DeleteForID(pHdbCallback root, int id){ - pHdbCallback current = root; - pHdbCallback tmp = NULL; - pHdbCallback result = NULL; - - if(root == NULL){ - return NULL; - } - - /* - * delete at the start of the chain - */ - result = root; - while(result->id == id){ - tmp = result; - result = result->next; - RemoveCallbackNode(tmp); - if(result == NULL){ - return NULL; - } - } - - /* - * delete nodes in the middle of the chain - */ - current = result; - while(current != NULL){ - if(current->id == id){ - tmp = current; - current = (pHdbCallback)current->next; - RemoveCallbackNode(tmp); - } else { - current = (pHdbCallback)current->next; - } - } - return result; -} -/*-----------------------------------------------------------------------*/ -static pHdbCallback DeleteForInternalID(pHdbCallback root, void *id){ - pHdbCallback current = root; - pHdbCallback tmp = NULL; - pHdbCallback result = NULL; - - if(root == NULL || id == NULL){ - return NULL; - } - - /* - * delete at the start of the chain - */ - result = root; - while(result->internalID == id){ - tmp = result; - result = result->next; - if(tmp->killFunc != NULL){ - tmp->killFunc(tmp->userData); - } - free(tmp); - if(result == NULL){ - return NULL; - } - } - - /* - * delete nodes in the middle of the chain - */ - current = result; - while(current != NULL){ - if(current->internalID == id){ - if(current->next != NULL){ - current->next->previous = current->previous; - } - if(current->previous != NULL){ - current->previous->next = current->next; - } - tmp = current; - current = (pHdbCallback)current->next; - if(tmp->killFunc != NULL){ - tmp->killFunc(tmp->userData); - } - free(tmp); - } else { - current = (pHdbCallback)current->next; - } - } - return result; -} /*----------------------------------------------------------------------*/ char *hdbTrim(char *str) { @@ -620,8 +634,7 @@ void AddHipadabaChild(pHdb parent, pHdb child, void *callData){ child->next = NULL; prev->next = child; } - InvokeCallbackChain(parent->treeChangeCallbacks, - parent,callData,parent->value); + SendTreeChangeMessage(parent,callData); } /*--------------------------------------------------------------------------*/ void DeleteHipadabaNode(pHdb node, void *callData){ @@ -730,8 +743,7 @@ char *GetHipadabaPath(pHdb node){ } /*==================== Callback Functions ==================================*/ pHdbCallback MakeHipadabaCallback(hdbCallbackFunction func, - void *userData, killUserData killFunc, - int id, void *internalID){ + void *userData, killUserData killFunc){ pHdbCallback pNew = NULL; assert(func != NULL); @@ -745,51 +757,17 @@ pHdbCallback MakeHipadabaCallback(hdbCallbackFunction func, pNew->userCallback = func; pNew->userData = userData; pNew->killFunc = killFunc; - pNew->id = id; - pNew->internalID = internalID; return pNew; } /*-------------------------------------------------------------------*/ -void AppendHipadabaCallback(pHdb node, int type, pHdbCallback newCB){ +void AppendHipadabaCallback(pHdb node, pHdbCallback newCB){ pHdbCallback current = NULL; assert(node); - switch(type){ - case HCBSET: - if(node->writeCallbacks == NULL){ - node->writeCallbacks = newCB; - return; - } else { - current = node->writeCallbacks; - } - break; - case HCBUPDATE: - if(node->updateCallbacks == NULL){ - node->updateCallbacks = newCB; - return; - } else { - current = node->updateCallbacks; - } - break; - case HCBREAD: - if(node->readCallbacks == NULL){ - node->readCallbacks = newCB; - return; - } else { - current = node->readCallbacks; - } - break; - case HCBTREE: - if(node->treeChangeCallbacks == NULL){ - node->treeChangeCallbacks = newCB; - return; - } else { - current = node->treeChangeCallbacks; - } - break; - default: - assert(0); - break; + current = node->callBackChain; + if(current == NULL){ + node->callBackChain = newCB; + return; } if(current != NULL){ while(current->next != NULL){ @@ -800,101 +778,28 @@ void AppendHipadabaCallback(pHdb node, int type, pHdbCallback newCB){ } } /*---------------------------------------------------------------------------*/ -void PrependHipadabaCallback(pHdb node, int type, pHdbCallback newCB){ - switch(type){ - case HCBSET: - if(node->writeCallbacks == NULL){ - node->writeCallbacks = newCB; - return; - } else { - newCB->next = node->writeCallbacks; - node->writeCallbacks->previous = newCB; - node->writeCallbacks = newCB; - } - break; - case HCBUPDATE: - if(node->updateCallbacks == NULL){ - node->updateCallbacks = newCB; - return; - } else { - newCB->next = node->updateCallbacks; - node->updateCallbacks->previous = newCB; - node->updateCallbacks = newCB; - } - break; - case HCBREAD: - if(node->readCallbacks == NULL){ - node->readCallbacks = newCB; - return; - } else { - newCB->next = node->readCallbacks; - node->readCallbacks->previous = newCB; - node->readCallbacks = newCB; - } - break; - case HCBTREE: - if(node->treeChangeCallbacks == NULL){ - node->treeChangeCallbacks = newCB; - return; - } else { - newCB->next = node->treeChangeCallbacks; - node->treeChangeCallbacks->previous = newCB; - node->treeChangeCallbacks = newCB; - } - break; - default: - assert(0); - break; +void PrependHipadabaCallback(pHdb node,pHdbCallback newCB){ + assert(node != NULL); + + newCB->next = node->callBackChain; + if(node->callBackChain != NULL){ + node->callBackChain->previous = newCB; } + node->callBackChain = newCB; } /*----------------------------------------------------------------------------*/ -void RemoveHipadabaCallback(pHdb root, int id){ - pHdb current = NULL; - - root->writeCallbacks = DeleteForID(root->writeCallbacks,id); - root->updateCallbacks = DeleteForID(root->updateCallbacks,id); - root->readCallbacks = DeleteForID(root->readCallbacks,id); - root->treeChangeCallbacks = DeleteForID(root->treeChangeCallbacks,id); - - current = root->child; - while(current != NULL){ - RemoveHipadabaCallback(current,id); - current = current->next; - } -} -/*----------------------------------------------------------------------------*/ -void InternalRemoveHipadabaCallback(pHdb root, void *internalID){ - pHdb current = NULL; - - root->writeCallbacks = DeleteForInternalID(root->writeCallbacks,internalID); - root->updateCallbacks = DeleteForInternalID(root->updateCallbacks,internalID); - root->readCallbacks = DeleteForInternalID(root->readCallbacks,internalID); - root->treeChangeCallbacks = DeleteForInternalID(root->treeChangeCallbacks,internalID); - - current = root->child; - while(current != NULL){ - InternalRemoveHipadabaCallback(current,internalID); - current = current->next; - } -} -/*----------------------------------------------------------------------------*/ -void *FindHdbCallbackData(pHdb node, int type, hdbCallbackFunction func - , void *internalID) { - pHdbCallback cb; +void *FindHdbCallbackData(pHdb node, hdbCallbackFunction func, + void *userPtr){ + hdbDataSearch dsm; - switch (type) { - case HCBSET: cb = node->writeCallbacks; break; - case HCBUPDATE: cb = node->updateCallbacks; break; - case HCBREAD: cb = node->readCallbacks; break; - case HCBTREE: cb = node->treeChangeCallbacks; break; - } - while (cb != NULL) { - if (cb->internalID == internalID && cb->userCallback == func) { - return cb->userData; - } - cb = cb->next; - } - return NULL; + dsm.type = dataSearch; + dsm.testFunc = func; + dsm.testPtr = userPtr; + dsm.result = NULL; + + InvokeCallbackChain(node, (pHdbMessage)&dsm); + return dsm.result; + } /*=================== parameter interface ====================================*/ static int canCopy(hdbValue *source, hdbValue *target){ @@ -990,32 +895,39 @@ int copyHdbValue(hdbValue *source, hdbValue *target){ } return 1; } +/*---------------------------------------------------------------------------*/ +static int SendDataMessage(pHdb node, char *type, + hdbValue v, void *callData){ + hdbDataMessage dataMes; + + if(strstr(type,"set") != NULL){ + dataMes.type = set; + } else if(strstr(type,"get") != NULL){ + dataMes.type = get; + } else if(strstr(type,"update") != NULL){ + dataMes.type = update; + } + dataMes.v = &v; + dataMes.callData = callData; + return InvokeCallbackChain(node, (pHdbMessage)&dataMes); +} /*----------------------------------------------------------------------------*/ int SetHipadabaPar(pHdb node, hdbValue v, void *callData){ - int status; - - status = InvokeCallbackChain(node->writeCallbacks, node, callData, v); - return status; + return SendDataMessage(node, set, v,callData); } /*-----------------------------------------------------------------------------*/ int UpdateHipadabaPar(pHdb node, hdbValue v, void *callData){ - int status; - - status = InvokeCallbackChain(node->updateCallbacks, node, callData, v); - if(status != 1 ){ - return status; - } - copyHdbValue(&v,&node->value); - return 1; + int status; + + status = SendDataMessage(node, update, v,callData); + if(status == 1){ + copyHdbValue(&v,&node->value); + } + return status; } /*-----------------------------------------------------------------------------*/ int NotifyHipadabaPar(pHdb node,void *callData){ - int status; - - status = InvokeCallbackChain(node->updateCallbacks, node, callData, node->value); - if(status != 1 ){ - return status; - } + SendDataMessage(node, update, node->value,callData); return 1; } /*-----------------------------------------------------------------------------*/ @@ -1024,7 +936,8 @@ int GetHipadabaPar(pHdb node, hdbValue *v, void *callData){ v->dataType = node->value.dataType; v->v.text = NULL; /* this sets all pointers in the union to NULL */ - status = InvokeCallbackChain(node->readCallbacks, node, callData, *v); + + status = SendDataMessage(node, get, *v,callData); if(status != 1 ){ return status; } @@ -1061,10 +974,8 @@ int SetHdbPar(pHdb node, int dataType, void *data, int length, } v = makeHdbData(dataType, length, data); - status = InvokeCallbackChain(node->writeCallbacks, node, callData, v); - if(status == 1) { - copyHdbValue(&v,&node->value); - } + status = SetHipadabaPar(node, v, callData); + ReleaseHdbValue(&v); return status; } /*--------------------------------------------------------------------------*/ @@ -1085,11 +996,8 @@ int UpdateHdbPar(pHdb node, int dataType, void *data, int length, } v = makeHdbData(dataType,length,data); - - status = InvokeCallbackChain(node->updateCallbacks, node, callData, v); - if(status == 1) { - copyHdbValue(&v,&node->value); - } + status = UpdateHipadabaPar(node,v,callData); + ReleaseHdbValue(&v); return status; } /*-----------------------------------------------------------------------------*/ @@ -1106,7 +1014,7 @@ int GetHdbPar(pHdb node, int dataType, void *data, int length, return HDBLENGTHMISMATCH; } - status = InvokeCallbackChain(node->readCallbacks, node, callData, v); + status = GetHipadabaPar(node, &v, callData); if(status != 1 ){ return status; } diff --git a/hipadaba.h b/hipadaba.h index 33489736..3ec100ee 100644 --- a/hipadaba.h +++ b/hipadaba.h @@ -24,6 +24,8 @@ * Added treeChange callback, Mark Koennecke, November 2006 * * Added support for properties, Mark Koennecke, January 2007 + * + * Refactored callback handling, Markus Zolliker, Mark Koennecke, March 2008 */ #ifndef HIPADABA #define HIPADABA @@ -40,11 +42,6 @@ #define HIPFLOATVARAR 6 #define HIPOBJ 7 #define HIPFUNC 8 -/* -------- callback types */ -#define HCBSET 0 -#define HCBUPDATE 1 -#define HCBREAD 2 -#define HCBTREE 3 /*--------- error codes */ #define HDBTYPEMISMATCH -7701 #define HDBLENGTHMISMATCH -7702 @@ -68,29 +65,87 @@ typedef struct __hipadaba { struct __hipadaba *mama; struct __hipadaba *child; struct __hipadaba *next; - struct __hdbcallback *writeCallbacks; - struct __hdbcallback *updateCallbacks; - struct __hdbcallback *readCallbacks; - struct __hdbcallback *treeChangeCallbacks; + struct __hdbcallback *callBackChain; char *name; hdbValue value; int protected; pStringDict properties; }Hdb, *pHdb; +/*-------------- return values for callback functions -------------------------*/ +typedef enum {hdbContinue, + hdbAbort, + hdbKill } hdbCallbackReturn; +/*======================== Messages ===========================================*/ +typedef struct __hdbMessage { + char *type; +} hdbMessage, *pHdbMessage; +/*-----------------------------------------------------------------------------*/ +typedef struct { + char *type; + hdbValue *v; + void *callData; +}hdbDataMessage, *pHdbDataMessage; /*-------------------------------------------------------------------------------*/ -typedef int (*hdbCallbackFunction)(void *userData, void *callData, - pHdb currentNode, hdbValue v); +typedef struct { + char *type; + void *callData; +}hdbTreeChangeMessage, *pHdbTreeChangeMessage; +/*-------------------------------------------------------------------------------*/ +typedef hdbCallbackReturn (*hdbCallbackFunction)(pHdb currentNode, + void *userData, + pHdbMessage message); + typedef void (*killUserData)(void *data); /*-------------------------------------------------------------------------------*/ typedef struct __hdbcallback { void *userData; killUserData killFunc; hdbCallbackFunction userCallback; - int id; - void *internalID; + int killFlag; struct __hdbcallback *next; struct __hdbcallback *previous; }hdbCallback, *pHdbCallback; +/*--------------- another message: must be here for seqeunce --------------------*/ +typedef struct { + char *type; + hdbCallbackFunction testFunc; + void *testPtr; + void *result; +}hdbDataSearch, *pHdbDataSearch; +/*============= Message Test Functions ==========================================*/ +/** + * Test a message if it is a set message + * @param toTest The message to test. + * @return NULL if the message is no set message or a message pointer if it is. + */ +pHdbDataMessage GetHdbSetMessage(pHdbMessage toTest); +/** + * Test a message if it is a set message + * @param toTest The message to test. + * @return NULL if the message is no set message or a message pointer if it is. + */ +pHdbDataMessage GetHdbGetMessage(pHdbMessage toTest); +/** + * Test a message if it is a update message + * @param toTest The message to test. + * @return NULL if the message is no update message or a message pointer if + * it is. + */ +pHdbDataMessage GetHdbUpdateMessage(pHdbMessage toTest); +/** + * Test a message if it is a tree change message + * @param toTest The message to test. + * @return NULL if the message is no tree change message or a message + * pointer if it is. + */ +pHdbTreeChangeMessage GetHdbTreeChangeMessage(pHdbMessage toTest); +/** + * Test a message if it is a data search message + * @param toTest The message to test. + * @return NULL if the message is no data search message or a message + * pointer if it is. + */ +pHdbDataSearch GetHdbDataSearchMessage(pHdbMessage toTest); /*======================== Function protoypes: hdbData ========================*/ hdbValue makeHdbValue(int datatype, int length); /** @@ -231,11 +286,6 @@ char *GetHipadabaPath(pHdb node); * @param callData User data for the tree change callback */ void RemoveHdbNodeFromParent(pHdb node, void *callData); -/** - * delete a callback chain - * @param root The callback chain to delete - */ -void DeleteCallbackChain(pHdbCallback root); /** * count the numbers of children in thie Hdb node * @param node The node to count children for @@ -249,50 +299,35 @@ int CountHdbChildren(pHdb node); * @param userData userData to be associated with this callback. Can be NULL. * @param killFunc A function for freeing the userData. Can be NULL, then it will * not be invoked - * @param id An ID associated with this callback - * @param internalID Another ID to be associated with this callback. Typically a - * reference to the owner object responsible for deleting the callback. * @return A new suitabaly initialised callback structure or NULL when required elements * are missing or there is nor memory. */ pHdbCallback MakeHipadabaCallback(hdbCallbackFunction func, - void *userData, killUserData killFunc, - int id, void *internalID); + void *userData, killUserData killFunc); /** * add a callback at the end of the callback chain * @param node The node to which to append the callback * @param type the type of the callback to append * @param newCB The callback to append */ -void AppendHipadabaCallback(pHdb node,int type, pHdbCallback newCB); +void AppendHipadabaCallback(pHdb node,pHdbCallback newCB); /** * add a callback at the head of the callback chain * @param node The node to which to append the callback * @param type the type of the callback to append * @param newCB The callback prepend */ -void PrependHipadabaCallback(pHdb node, int type, pHdbCallback newCB); -/** - * remove recursively all callbacks witch match the id - * @param root The starting node from where to start removing callbacks - * @param id The ID callbacks have to match in order to be removed. - */ -void RemoveHipadabaCallback(pHdb root, int id); -/** - * remove recursively all callbacks witch match the internal id - * @param root The starting node from where to start removing callbacks - * @param internalID The internal ID callbacks have to match in order to be removed. - */ -void InternalRemoveHipadabaCallback(pHdb root, void *internalID); +void PrependHipadabaCallback(pHdb node,pHdbCallback newCB); /** * find the callback data * @param node the node from where callbacks have to be searched - * @param type the type of the callback to be searched * @param func the function registered with the searched callback + * @param userPtr A pointer to some user data whih the callback + * uses to determine if it is the right one. * @return the found callback user data or NULL on failure */ -void *FindHdbCallbackData(pHdb node, int type, hdbCallbackFunction func - , void *internalID); +void *FindHdbCallbackData(pHdb node,hdbCallbackFunction func, + void *userPtr); /** * invoke a callback chain. * @param root The callback chain to invoke @@ -301,9 +336,19 @@ void *FindHdbCallbackData(pHdb node, int type, hdbCallbackFunction func * @param v The new value for this callback * @return 1 on success, 0 on failure */ -int InvokeCallbackChain(pHdbCallback root, pHdb node, - void *callData, hdbValue v); - +int InvokeCallbackChain(pHdb node, pHdbMessage message); +/** + * Deletes a callback chain. This is internal, normal users + * should nto use this function. Or you create a mess! + * @param root The callback chain to remove + */ +void DeleteCallbackChain(pHdbCallback root); +/** + * apply message to the node and all its children + * @param node Th node where to start recursing + * @param message The message to send + */ +void RecurseCallbackChains(pHdb node, pHdbMessage message); /*============== Parameter Handling ===============================*/ /** * Set a hipadaba parameter. This is an external set for a parameter. It may cause diff --git a/logsetup.c b/logsetup.c index cf7445d6..f1343532 100644 --- a/logsetup.c +++ b/logsetup.c @@ -2,14 +2,33 @@ #include "sics.h" #include "sicshipadaba.h" -static int LoggerUpdateCallback(void *user, void *conn, pHdb node, hdbValue value) { - Logger *logger = user; +static hdbCallbackReturn LoggerUpdateCallback(pHdb node, void *userData, + pHdbMessage message) { + Logger *logger = userData; pDynString str; + SConnection *conn = NULL; + hdbValue value; + pHdbDataMessage mm = NULL; + pHdbDataSearch dsm = NULL; + + if((dsm = GetHdbDataSearchMessage(message)) != NULL){ + if(dsm->testFunc == LoggerUpdateCallback){ + dsm->result = userData; + return hdbAbort; + } + return hdbContinue; + } + + if((mm = GetHdbUpdateMessage(message)) == NULL){ + return hdbContinue; + } + + value = *(mm->v); str = formatValue(value, node); LoggerWrite(logger, time(NULL), LoggerPeriod(logger), GetCharArray(str)); DeleteDynString(str); - return 1; + return hdbContinue; } static int LogSetup(SConnection *pCon, SicsInterp *pSics, void *pData, @@ -73,15 +92,15 @@ static int LogSetup(SConnection *pCon, SicsInterp *pSics, void *pData, } else { numeric = 0; } - logger = FindHdbCallbackData(node, HCBUPDATE, LoggerUpdateCallback, NULL); + logger = FindHdbCallbackData(node, LoggerUpdateCallback, NULL); if (logger != 0) { /* logger exists already, changed only period */ LoggerSetPeriod(logger, period); } else { logger = LoggerMake(name, period, !numeric); LoggerSetNumeric(logger, numeric); - cb = MakeHipadabaCallback(LoggerUpdateCallback, logger, (void (*)(void *))LoggerKill, -1, NULL); + cb = MakeHipadabaCallback(LoggerUpdateCallback, logger, (void (*)(void *))LoggerKill); assert(cb); - AppendHipadabaCallback(node, HCBUPDATE, cb); + AppendHipadabaCallback(node, cb); } return 1; diff --git a/make_gen b/make_gen index 8b87bb79..3513e9bd 100644 --- a/make_gen +++ b/make_gen @@ -35,7 +35,7 @@ SOBJ = network.o ifile.o conman.o SCinter.o splitter.o passwd.o \ savehdb.o statusfile.o \ moregress.o hdbcommand.o multicounter.o regresscter.o histregress.o \ sicshdbadapter.o polldriv.o sicspoll.o statemon.o hmslave.o \ - nwatch.o asyncqueue.o asyncprotocol.o sicsobj.o hdbqueue.o\ + nwatch.o asyncqueue.o asyncprotocol.o sicsobj.o \ nxcopy.o nxinterhelper.o nxinter_wrap.o genericcontroller.o nxstack.o MOTOROBJ = motor.o simdriv.o diff --git a/ofac.c b/ofac.c index 34c5e703..2e7788dc 100644 --- a/ofac.c +++ b/ofac.c @@ -345,7 +345,7 @@ AddCommand(pInter,"MakeAsyncQueue",AsyncQueueFactory,NULL,NULL); AddCommand(pInter,"MakeSicsObj",InstallSICSOBJ,NULL,NULL); AddCommand(pInter,"DynSicsObj",InstallSICSOBJ,NULL,NULL); - AddCommand(pInter,"MakeHdbQueue",MakeHDBQueue,NULL,NULL); +/* AddCommand(pInter,"MakeHdbQueue",MakeHDBQueue,NULL,NULL); */ AddCommand(pInter,"MakeGenController",GenControllerFactory,NULL,NULL); AddCommand(pInter,"genconfigure",GenControllerConfigure,NULL,NULL); diff --git a/savehdb.c b/savehdb.c index 0785de89..b4b29523 100644 --- a/savehdb.c +++ b/savehdb.c @@ -29,9 +29,16 @@ static int SaveHdbTree(void *object, char *name, FILE *fil) { return 1; } -static int SaveHdbCallback(void *user, void *conn, pHdb node, hdbValue value) { +static hdbCallbackReturn SaveHdbCallback(pHdb node, void *userData, + pHdbMessage message) { + pHdbDataMessage mm = NULL; + + if((mm = GetHdbUpdateMessage(message)) == NULL){ + return hdbContinue; + } + StatusFileDirty(); - return 1; + return hdbContinue;; } static int SaveHdbEnable(SConnection *con, SicsInterp *sics, @@ -50,9 +57,9 @@ static int SaveHdbEnable(SConnection *con, SicsInterp *sics, SCPrintf(con, eError, "ERROR: %s not found", argv[1]); return 0; } - cb = MakeHipadabaCallback(SaveHdbCallback, NULL, NULL, -1, NULL); + cb = MakeHipadabaCallback(SaveHdbCallback, NULL, NULL); assert(cb); - AppendHipadabaCallback(node, HCBUPDATE, cb); + AppendHipadabaCallback(node,cb); SetHdbProperty(node, "save", "me"); for (node = node->mama; node != NULL; node = node->mama) { diff --git a/scriptcontext.c b/scriptcontext.c index fe6afc46..f931e1e8 100644 --- a/scriptcontext.c +++ b/scriptcontext.c @@ -202,11 +202,36 @@ static void SctSetDirty(SctChain *sc) { sc->doit = 1; } -static int SctUpdateCallback(void *user, void *conn, pHdb node, hdbValue value) { - SctParData *data = user; +static hdbCallbackReturn SctUpdateCallback(pHdb node, void *userData, + pHdbMessage message) { + SctParData *data = userData; SConnection *con; char path[MAX_HDB_PATH]; pDynString str; + pHdbPtrMessage pm = NULL; + pHdbDataMessage mm = NULL; + pHdbDataSearch dsm = NULL; + hdbValue value; + + if((pm = GetKillPtrMessage(message)) != NULL){ + if(data->sct == pm->pPtr){ + return hdbKill; + } + return hdbContinue; + } + + if((dsm = GetHdbDataSearchMessage(message)) != NULL){ + if(dsm->testFunc == SctUpdateCallback && dsm->testPtr == data->sct){ + dsm->result = userData; + return hdbAbort; + } + return hdbContinue; + } + + if((mm = GetHdbUpdateMessage(message)) == NULL) { + return hdbContinue; + } + value = *(mm->v); if (data->inprogress) { if (data->sct->operation == sct_complete_keyword) { @@ -220,15 +245,33 @@ static int SctUpdateCallback(void *user, void *conn, pHdb node, hdbValue value) SCStorePop(data->conCtx); } } - return 1; + return hdbContinue;; } -static int SctSetCallback(void *user, void *conn, pHdb node, hdbValue value) { - SctParData *data = user; +static hdbCallbackReturn SctSetCallback(pHdb node, void *userData, + pHdbMessage message) { + SctParData *data = userData; SConnection *oldCon; char path[MAX_HDB_PATH]; pDynString str; pHdb target; + SConnection *conn = NULL; + pHdbPtrMessage pm = NULL; + pHdbDataMessage mm = NULL; + hdbValue value; + + if((pm = GetKillPtrMessage(message)) != NULL){ + if(data->sct == pm->pPtr){ + return hdbKill; + } + return hdbContinue; + } + + if((mm = GetHdbSetMessage(message)) == NULL) { + return hdbContinue; + } + value = *(mm->v); + conn = mm->callData; if (data->setChain) { if (data->pending) { @@ -247,16 +290,25 @@ static int SctSetCallback(void *user, void *conn, pHdb node, hdbValue value) { if (target) { UpdateHipadabaPar(target, value, NULL); } - return 1; + return hdbContinue; } - return 1; + return hdbContinue; } -static int SctReadCallback(void *user, void *conn, pHdb node, hdbValue value) { - SctParData *data = user; +static hdbCallbackReturn SctReadCallback(pHdb node, void *userData, + pHdbMessage message) { + SctParData *data = userData; + pHdbPtrMessage pm = NULL; + + if((pm = GetKillPtrMessage(message)) != NULL){ + if(data->sct == pm->pPtr){ + return hdbKill; + } + return hdbContinue; + } /* not used ? */ - return 1; + return hdbContinue; } int SctCallDynamicScript(Sct *sct, char *name, char *script) { @@ -372,7 +424,7 @@ static int SctExec(SConnection *con, SicsInterp *sics, void *object, int argc, c if (node == 0) goto quit; memset(&newValue,0,sizeof(hdbValue)); if (keyword == sct_take_keyword) { - data = FindHdbCallbackData(node, HCBUPDATE, SctUpdateCallback, sct); + data = FindHdbCallbackData(node, SctUpdateCallback, sct); result = NULL; if (data) { if (data->pending) { @@ -750,7 +802,7 @@ int SctAddNode2Script(Sct *sct, SctChain *sc, pHdb node, SConnection *con) { pHdb child; hdbValue hval; - data = FindHdbCallbackData(node, HCBUPDATE, SctUpdateCallback, sct); + data = FindHdbCallbackData(node,SctUpdateCallback, sct); if (data == NULL) { data = calloc(1, sizeof(*data)); assert(data); @@ -762,17 +814,17 @@ int SctAddNode2Script(Sct *sct, SctChain *sc, pHdb node, SConnection *con) { data->conCtx = NULL; data->refCnt = 3; /* insert 3 times */ - cb = MakeHipadabaCallback(SctUpdateCallback, data, SctFreeParData, -1, sct); + cb = MakeHipadabaCallback(SctUpdateCallback, data, SctFreeParData); assert(cb); - AppendHipadabaCallback(node, HCBUPDATE, cb); + AppendHipadabaCallback(node,cb); - cb = MakeHipadabaCallback(SctSetCallback, data, SctFreeParData, -1, sct); + cb = MakeHipadabaCallback(SctSetCallback, data, SctFreeParData); assert(cb); - AppendHipadabaCallback(node, HCBSET, cb); + AppendHipadabaCallback(node,cb); - cb = MakeHipadabaCallback(SctReadCallback, data, SctFreeParData, -1, sct); + cb = MakeHipadabaCallback(SctReadCallback, data, SctFreeParData); assert(cb); - AppendHipadabaCallback(node, HCBREAD, cb); + AppendHipadabaCallback(node,cb); } else { if (data->sct != sct) { SCPrintf(con, eError, "ERROR: node is already attached to another script context controller"); diff --git a/sicshdbadapter.c b/sicshdbadapter.c index fbc14845..a65c91b8 100644 --- a/sicshdbadapter.c +++ b/sicshdbadapter.c @@ -93,27 +93,47 @@ static int MotorValueCallback(int iEvent, void *eventData, void *userData, return 1; } /*---------------------------------------------------------------------*/ -static int MotorParSetCallback(void *userData, void *callData, - pHdb currentNode, hdbValue v){ +static hdbCallbackReturn MotorParSetCallback(pHdb currentNode, void *userData, + pHdbMessage message){ pMotor pMot = (pMotor)userData; - SConnection *pCon = (SConnection *)callData; + SConnection *pCon = NULL; int status; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } + pCon = mm->callData; assert(pMot != NULL && pCon != NULL); - status = MotorSetPar(pMot,pCon,currentNode->name, (float)v.v.doubleValue); - return status; + status = MotorSetPar(pMot,pCon,currentNode->name, + (float)mm->v->v.doubleValue); + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } } /*----------------------------------------------------------------------*/ -static int MotorParGetCallback(void *userData, void *callData, - pHdb currentNode, hdbValue v){ +static hdbCallbackReturn MotorParGetCallback(pHdb currentNode, void *userData, + pHdbMessage message){ pMotor pMot = (pMotor)userData; float fVal; int status; - + pHdbDataMessage mm = NULL; + + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } + assert(pMot != NULL); status = MotorGetPar(pMot,currentNode->name,&fVal); currentNode->value.v.doubleValue = fVal; - return status; + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } } /*---------------------------------------------------------------------*/ static pHdb MakeMotParNode(char *name, pMotor pMot){ @@ -123,16 +143,16 @@ static pHdb MakeMotParNode(char *name, pMotor pMot){ node = MakeHipadabaNode(name, HIPFLOAT, 1); if(node != NULL) { - pCall = MakeHipadabaCallback(MotorParSetCallback,pMot,NULL,-1,NULL); + pCall = MakeHipadabaCallback(MotorParSetCallback,pMot,NULL); if(pCall == NULL){ return NULL; } - AppendHipadabaCallback(node,HCBSET,pCall); - pCall = MakeHipadabaCallback(MotorParGetCallback,pMot,NULL,-1,NULL); + AppendHipadabaCallback(node,pCall); + pCall = MakeHipadabaCallback(MotorParGetCallback,pMot,NULL); if(pCall == NULL){ return NULL; } - AppendHipadabaCallback(node,HCBREAD,pCall); + AppendHipadabaCallback(node,pCall); snprintf(command,1023,"%s %s ", pMot->name, name); SetHdbProperty(node,"sicscommand", command); } @@ -289,15 +309,20 @@ static long totalSum(int *data, int length){ return result; } /*----------------------------------------------------------------------*/ -static int HMDataGetCallback(void *userData, void *callData, - pHdb currentNode, hdbValue v){ +static hdbCallbackReturn HMDataGetCallback(pHdb currentNode, void *userData, + pHdbMessage message){ pHistMem pHM = (pHistMem)userData; - SConnection *pCon = (SConnection *)callData; + SConnection *pCon = NULL; long sum1, sum2; + pHdbDataMessage mm = NULL; + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } + pCon = mm->callData; assert(pHM != NULL); if(pCon == NULL){ - return 0; + return hdbAbort; } sum1 = totalSum(currentNode->value.v.intArray, currentNode->value.arrayLength); currentNode->value.arrayLength = GetHistLength(pHM); @@ -306,7 +331,7 @@ static int HMDataGetCallback(void *userData, void *callData, if(sum1 != sum2){ UpdateHipadabaPar(currentNode,currentNode->value,NULL); } - return 1; + return hdbContinue; } /*----------------------------------------------------------------------*/ static pHdb MakeHMDataNode(pHistMem pHM, char *name){ @@ -319,21 +344,27 @@ static pHdb MakeHMDataNode(pHistMem pHM, char *name){ return NULL; } node->value.doNotFree = 1; - pCall = MakeHipadabaCallback(HMDataGetCallback,pHM,NULL,-1,NULL); + pCall = MakeHipadabaCallback(HMDataGetCallback,pHM,NULL); if(pCall == NULL){ return NULL; } - AppendHipadabaCallback(node,HCBREAD,pCall); - AppendHipadabaCallback(node,HCBSET,MakeReadOnlyCallback()); + AppendHipadabaCallback(node,pCall); + AppendHipadabaCallback(node,MakeReadOnlyCallback()); return node; } /*================ SICS Variable ======================================*/ -static int SicsVarSetCallback(void *userData, void *callData, - pHdb currentNode, hdbValue v){ +static hdbCallbackReturn SicsVarSetCallback(pHdb currentNode, void *userData, + pHdbMessage message){ pSicsVariable pVar = (pSicsVariable)userData; - SConnection *pCon = (SConnection *)callData; + SConnection *pCon = NULL; int userRights = usMugger; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } + pCon = mm->callData; assert(pVar != NULL); @@ -342,16 +373,16 @@ static int SicsVarSetCallback(void *userData, void *callData, } switch(currentNode->value.dataType){ case HIPINT: - VarSetInt(pVar, v.v.intValue, userRights); + VarSetInt(pVar, mm->v->v.intValue, userRights); break; case HIPFLOAT: - VarSetFloat(pVar, (float)v.v.doubleValue, userRights); + VarSetFloat(pVar, (float)mm->v->v.doubleValue, userRights); break; case HIPTEXT: - VarSetText(pVar, v.v.text, userRights); + VarSetText(pVar, mm->v->v.text, userRights); break; } - return 1; + return hdbContinue; } /*----------------------------------------------------------------------*/ static int ValueCallback(int iEvent, void *eventData, void *userData, @@ -405,13 +436,13 @@ static pHdb MakeSicsVarNode(pSicsVariable pVar, char *name){ } else { AddPrivProperty(node,pVar->iAccessCode); } - pCall = MakeHipadabaCallback(SicsVarSetCallback,pVar,NULL,-1,NULL); + pCall = MakeHipadabaCallback(SicsVarSetCallback,pVar,NULL); if(pCall == NULL){ return NULL; } strncpy(comCom.deviceID,name,255); comCom.transID = -77; - AppendHipadabaCallback(node,HCBSET,pCall); + AppendHipadabaCallback(node,pCall); RegisterCallback(pVar->pCall,comCom, VALUECHANGE, ValueCallback, node,NULL); snprintf(command,1023,"%s ", pVar->name); diff --git a/sicshipadaba.c b/sicshipadaba.c index 387ed5f3..7b2937dc 100644 --- a/sicshipadaba.c +++ b/sicshipadaba.c @@ -15,6 +15,8 @@ * * TODO: separate this into two modules: sicshipadaba proper and sicshipadabaint for the * interpreter interface. + * + * Refactored to new callback system, Markus Zolliker, Mark Koennecke, March 2008 */ #include #include @@ -40,15 +42,47 @@ typedef enum { json_protocol, } Protocol; char *trim(char *str); +/*====================== Messages ==================================================*/ +static char killID[] = {"killID"}; +static char killInternalID[] = {"killInternalID"}; +static char killPtr[] = {"killPtr"}; +/*----------------------------------------------------------------------------------*/ +pHdbIDMessage GetKillIDMessage(pHdbMessage message){ + if(message->type == killID){ + return (pHdbIDMessage)message; + } + return NULL; +} +/*-----------------------------------------------------------------------------------*/ +pHdbIDMessage GetKillInternalIDMessage(pHdbMessage message){ + if(message->type == killInternalID){ + return (pHdbIDMessage)message; + } + return NULL; +} +/*-----------------------------------------------------------------------------------*/ +pHdbPtrMessage GetKillPtrMessage(pHdbMessage message){ + if(message->type == killPtr){ + return (pHdbPtrMessage)message; + } + return NULL; +} + /*=============== common callback functions used for SICS ===========================*/ -static int SICSCheckPermissionCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSCheckPermissionCallback(pHdb node, void *userData, + pHdbMessage message){ int *testPriv = NULL; SConnection *pCon = NULL; + pHdbDataMessage mm = NULL; - pCon = (SConnection *)callData; testPriv = (int *)userData; + mm = GetHdbSetMessage(message); + if(mm == NULL){ + return hdbContinue; + } + pCon = (SConnection *)mm->callData; + /* * If pCon is NULL, then this is an internal call from some driver * code where no permission check is necessary. However, when called @@ -56,15 +90,15 @@ static int SICSCheckPermissionCallback(void *userData, void *callData, pHdb node * check will be honoured. */ if(pCon == NULL){ - return 1; + return hdbContinue; } assert(testPriv != NULL); if(SCMatchRights(pCon,*testPriv) == 1){ - return 1; + return hdbContinue; } else { - return SICSCBPERM; + return hdbAbort; } } /*--------------------------------------------------------------------------------------*/ @@ -76,65 +110,97 @@ pHdbCallback MakeCheckPermissionCallback(int priv){ return NULL; } *testPriv = priv; - return MakeHipadabaCallback(SICSCheckPermissionCallback, testPriv,free,-1,NULL); + return MakeHipadabaCallback(SICSCheckPermissionCallback, testPriv,free); } /*-------------------------------------------------------------------------------------*/ -static int SICSSetUpdateCallback(void *userData, void *callData, pHdb node, - hdbValue v){ - return UpdateHipadabaPar(node,v,callData); +static hdbCallbackReturn SICSSetUpdateCallback(pHdb node, void *userData, + pHdbMessage message){ + pHdbDataMessage mm = NULL; + + mm = GetHdbSetMessage(message); + if(mm == NULL){ + return hdbContinue; + } + UpdateHipadabaPar(node,*(mm->v),mm->callData); + return hdbContinue; } /*-------------------------------------------------------------------------------------*/ pHdbCallback MakeSetUpdateCallback(){ - return MakeHipadabaCallback(SICSSetUpdateCallback, NULL,NULL,-1,NULL); + return MakeHipadabaCallback(SICSSetUpdateCallback, NULL,NULL); } /*---------------------------------------------------------------------------------------*/ -static int SICSReadOnlyCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSReadOnlyCallback(pHdb node, void *userData, pHdbMessage message){ SConnection *pCon = NULL; + pHdbDataMessage mm = NULL; - pCon = (SConnection *)callData; + mm = GetHdbSetMessage(message); + if(mm == NULL){ + return hdbContinue; + } + pCon = (SConnection *)mm->callData; if(pCon != NULL){ SCWrite(pCon,"ERROR: parameter is READ-ONLY", eError); } - return SICSCBRO; + return hdbAbort; } /*-------------------------------------------------------------------------------------*/ pHdbCallback MakeReadOnlyCallback(){ - return MakeHipadabaCallback(SICSReadOnlyCallback, NULL,NULL,-1,NULL); + return MakeHipadabaCallback(SICSReadOnlyCallback, NULL,NULL); } /*-------------------------------------------------------------------------------------*/ -static int SICSDriveCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSDriveCallback(pHdb node, void *userData, + pHdbMessage message){ SConnection *pCon = NULL; pDummy dum = NULL; char pSicsdev[80]; + int status; + pHdbDataMessage mm = NULL; + hdbValue v; + + mm = GetHdbSetMessage(message); + if(mm == NULL){ + return hdbContinue; + } + + pCon = (SConnection *)mm->callData; + v = *(mm->v); - pCon = (SConnection *)callData; dum = (pDummy)userData; assert(pCon != NULL && dum != NULL); if(GetHdbProperty(node,"sicsdev",pSicsdev,79)){ - return StartDevice(pServ->pExecutor,pSicsdev,dum->pDescriptor, + status = StartDevice(pServ->pExecutor,pSicsdev,dum->pDescriptor, userData, pCon, (float)v.v.doubleValue); } else { - return StartDevice(pServ->pExecutor,node->name,dum->pDescriptor, + status = StartDevice(pServ->pExecutor,node->name,dum->pDescriptor, userData, pCon, (float)v.v.doubleValue); } + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } } /*---------------------------------------------------------------------------------------*/ pHdbCallback MakeSICSDriveCallback(void *sicsObject){ - return MakeHipadabaCallback(SICSDriveCallback, sicsObject,NULL,-1,NULL); + return MakeHipadabaCallback(SICSDriveCallback, sicsObject,NULL); } /*---------------------------------------------------------------------------------------*/ -static int SICSReadDriveCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSReadDriveCallback(pHdb node, void *userData, + pHdbMessage message){ static SConnection *defCon = NULL; SConnection *pCon = NULL; pDummy dum = NULL; pIDrivable pDriv = NULL; float value; + pHdbDataMessage mm = NULL; - pCon = (SConnection *)callData; + mm = GetHdbGetMessage(message); + if(mm == NULL){ + return hdbContinue; + } + + pCon = (SConnection *)mm->callData; dum = (pDummy)userData; assert(dum != NULL); @@ -147,27 +213,34 @@ static int SICSReadDriveCallback(void *userData, void *callData, pHdb node, if(pCon != NULL){ value = pDriv->GetValue(dum,pCon); node->value.v.doubleValue = (double)value; - v.v.doubleValue = (double)value; + mm->v->v.doubleValue = (double)value; } else { if(defCon != NULL){ value = pDriv->GetValue(dum,defCon); node->value.v.doubleValue = (double)value; - v.v.doubleValue = (double)value; + mm->v->v.doubleValue = (double)value; } } - return 1; + return hdbContinue; } /*--------------------------------------------------------------------------*/ -static int SICSFuncCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSFuncCallback(pHdb node, void *userData, + pHdbMessage message){ pHdb par[64], current = NULL; int nPar = 0; SICSOBJFunc func = NULL; + pHdbDataMessage mm = NULL; + int status; + + mm = GetHdbSetMessage(message); + if(mm == NULL){ + return hdbContinue; + } assert(node->value.dataType == HIPFUNC); - if(userData == NULL || callData == NULL){ + if(userData == NULL || mm->callData == NULL){ printf("Great Badness in calling SICSFuncCallback\n"); - return 0; + return hdbAbort; } current = node->child; @@ -178,24 +251,32 @@ static int SICSFuncCallback(void *userData, void *callData, pHdb node, } func = (SICSOBJFunc)node->value.v.obj; if(func != NULL){ - return func((pSICSOBJ)userData,(SConnection *)callData, node, par,nPar); + status = func((pSICSOBJ)userData,(SConnection *)mm->callData, + node, par,nPar); } else { printf("Great Badness in calling SICSFuncCallback\n"); - return 0; + return hdbAbort; + } + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; } } /*---------------------------------------------------------------------------*/ pHdbCallback MakeSICSFuncCallback(void *obj){ - return MakeHipadabaCallback(SICSFuncCallback, obj,NULL,-1,NULL); + return MakeHipadabaCallback(SICSFuncCallback, obj,NULL); } /*--------------------------------------------------------------------------------------*/ pHdbCallback MakeSICSReadDriveCallback(void *sicsObject){ - return MakeHipadabaCallback(SICSReadDriveCallback, sicsObject,NULL,-1,NULL); + return MakeHipadabaCallback(SICSReadDriveCallback, sicsObject,NULL); } /*---------------------------------------------------------------------------------------*/ typedef struct { SConnection *pCon; commandContext context; + int ID; + int internalID; }HdbCBInfo; static Protocol isJSON(SConnection *pCon) { @@ -308,8 +389,8 @@ static int sendZippedNodeData(pHdb node, SConnection *pCon){ return 1; } /*----------------------------------------------------------------------------------------*/ -static int SICSNotifyCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSNotifyCallback(pHdb node, void *userData, + pHdbMessage message ){ HdbCBInfo *cbInfo = NULL; pDynString printedData = NULL; pDynString result = NULL; @@ -317,8 +398,44 @@ static int SICSNotifyCallback(void *userData, void *callData, pHdb node, Protocol protocol = normal_protocol; int outCode, macro, status; char value[80]; - + pHdbIDMessage idm = NULL; + pHdbPtrMessage cmm = NULL; + pHdbDataMessage mm = NULL; + cbInfo = (HdbCBInfo *)userData; + + /* + * handle kills first + */ + if((idm = GetKillIDMessage(message)) != NULL){ + if(idm->ID == cbInfo->ID){ + return hdbKill; + } else { + return hdbContinue; + } + } + if((idm = GetKillInternalIDMessage(message)) != NULL){ + if(idm->ID == cbInfo->internalID){ + return hdbKill; + } else { + return hdbContinue; + } + } + if((cmm = GetKillPtrMessage(message)) != NULL){ + if(cmm->pPtr == cbInfo->pCon){ + return hdbKill; + } else { + return hdbContinue; + } + } + + /* + * react only on update messages + */ + if((mm = GetHdbUpdateMessage(message)) == NULL){ + return hdbContinue; + } + pPath = GetHipadabaPath(node); result = CreateDynString(128,128); if ((protocol = isJSON(cbInfo->pCon)) == 1) @@ -326,6 +443,7 @@ static int SICSNotifyCallback(void *userData, void *callData, pHdb node, else outCode = eEvent; + /* * we want our notifications to come even when called from a macro */ @@ -342,11 +460,11 @@ static int SICSNotifyCallback(void *userData, void *callData, pHdb node, SCsetMacro(cbInfo->pCon,macro); free(pPath); DeleteDynString(result); - return status; + return hdbContinue; } } - if(v.arrayLength < 100){ - printedData = formatValue(v, node); + if(mm->v->arrayLength < 100){ + printedData = formatValue(*(mm->v), node); if(pPath == NULL || printedData == NULL || result == NULL){ SCWriteInContext(cbInfo->pCon,"ERROR: out of memory formatting data" , eEvent,cbInfo->context); @@ -355,9 +473,10 @@ static int SICSNotifyCallback(void *userData, void *callData, pHdb node, * no need to interrupt something because writing data to a client does * not work */ - return 1; + return hdbContinue; } - formatNameValue(protocol, pPath, GetCharArray(printedData), result, v.dataType); + formatNameValue(protocol, pPath, GetCharArray(printedData), result, + mm->v->dataType); SCWriteInContext(cbInfo->pCon,GetCharArray(result), outCode,cbInfo->context); DeleteDynString(printedData); @@ -370,7 +489,7 @@ static int SICSNotifyCallback(void *userData, void *callData, pHdb node, free(pPath); DeleteDynString(result); - return 1; + return hdbContinue; } /*-----------------------------------------------------------------------------------------*/ pHdbCallback MakeNotifyCallback(SConnection *pCon, int id){ @@ -382,32 +501,66 @@ pHdbCallback MakeNotifyCallback(SConnection *pCon, int id){ } cbInfo->pCon = pCon; cbInfo->context = SCGetContext(pCon); - return MakeHipadabaCallback(SICSNotifyCallback, cbInfo,free,id,pCon); + cbInfo->ID = id; + cbInfo->internalID = -1; + return MakeHipadabaCallback(SICSNotifyCallback, cbInfo,free); } /*-------------------------------------------------------------------------*/ -static int TreeChangeCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn TreeChangeCallback(pHdb node, void *userData, + pHdbMessage message){ char *path = NULL; char buffer[1024]; pDynString result = NULL; Protocol protocol = normal_protocol; int outCode; - + pHdbIDMessage idm = NULL; + pHdbPtrMessage cmm = NULL; + pHdbTreeChangeMessage tm = NULL; + result = CreateDynString(128,128); HdbCBInfo *cbInfo = (HdbCBInfo *)userData; + /* + * handle kills first + */ + if((idm = GetKillIDMessage(message)) != NULL){ + if(idm->ID == cbInfo->ID){ + return hdbKill; + } else { + return hdbContinue; + } + } + if((idm = GetKillInternalIDMessage(message)) != NULL){ + if(idm->ID == cbInfo->internalID){ + return hdbKill; + } else { + return hdbContinue; + } + } + if((cmm = GetKillPtrMessage(message)) != NULL){ + if(cmm->pPtr == cbInfo->pCon){ + return hdbKill; + } else { + return hdbContinue; + } + } + + if((tm = GetHdbTreeChangeMessage(message)) == NULL){ + return hdbContinue; + } + if(cbInfo != NULL && cbInfo->pCon != NULL){ path = GetHipadabaPath(node); if ((protocol = isJSON(cbInfo->pCon)) == 1) outCode = eHdbEvent; else outCode = eEvent; - formatNameValue(protocol, "treechange", path, result, v.dataType); + formatNameValue(protocol, "treechange", path, result, node->value.dataType); SCWriteInContext(cbInfo->pCon,GetCharArray(result),outCode,cbInfo->context); DeleteDynString(result); free(path); } - return 1; + return hdbContinue; } /*-------------------------------------------------------------------------*/ pHdbCallback MakeTreeChangeCallback(SConnection *pCon, int id){ @@ -419,26 +572,32 @@ pHdbCallback MakeTreeChangeCallback(SConnection *pCon, int id){ } cbInfo->pCon = pCon; cbInfo->context = SCGetContext(pCon); - return MakeHipadabaCallback(TreeChangeCallback, cbInfo,free,id,pCon); + cbInfo->ID = id; + return MakeHipadabaCallback(TreeChangeCallback, cbInfo,free); } /*----------------------------------------------------------------------------------------*/ -static int SICSScriptWriteCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSScriptWriteCallback(pHdb node, void *userData, + pHdbMessage message){ char *command = NULL; SConnection *pCon = NULL; pDynString newVal = NULL; char error[1024]; int status; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } command = (char *)userData; - pCon = (SConnection *)callData; + pCon = (SConnection *)mm->callData; assert(command != NULL && pCon != NULL); - newVal = formatValue(v, node); + newVal = formatValue(*(mm->v), node); if(newVal == NULL){ SCWrite(pCon,"ERROR: out of memory setting parameter",eError); - return 0; + return hdbAbort; } /** @@ -460,23 +619,32 @@ static int SICSScriptWriteCallback(void *userData, void *callData, pHdb node, status = 1; } DeleteDynString(newVal); - return status; + if(status == 1){ + return hdbContinue; + } else{ + return hdbAbort; + } } /*---------------------------------------------------------------------------------------*/ static pHdbCallback MakeSICSWriteScriptCallback(char *script){ - return MakeHipadabaCallback(SICSScriptWriteCallback, strdup(script),free,-1,NULL); + return MakeHipadabaCallback(SICSScriptWriteCallback, strdup(script),free); } /*----------------------------------------------------------------------------------------*/ -static int SICSScriptReadCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSScriptReadCallback(pHdb node, void *userData, + pHdbMessage message){ char *command = NULL, *data = NULL, *equal = NULL; SConnection *pCon = NULL; pDynString newVal = NULL; char error[1024]; int status; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } command = (char *)userData; - pCon = (SConnection *)callData; + pCon = (SConnection *)mm->callData; assert(command != NULL); @@ -505,7 +673,7 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node, if(pCon != NULL){ SCWrite(pCon,"ERROR: no result returned from script",eError); } - return 0; + return hdbAbort; } equal = strchr(data,'='); if(equal != NULL){ @@ -517,14 +685,18 @@ static int SICSScriptReadCallback(void *userData, void *callData, pHdb node, if(pCon != NULL){ SCWrite(pCon,error,eError); } - return 0; + return hdbAbort; } - return status; -} + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } +} /*----------------------------------------------------------------------------*/ static pHdbCallback MakeSICSReadScriptCallback(char *script){ return MakeHipadabaCallback(SICSScriptReadCallback, strdup(script), - free,-1,NULL); + free); } /*---------------------------------------------------------------------------*/ typedef struct { @@ -532,27 +704,33 @@ typedef struct { int max; }hdbIntRange, *pHdbIntRange; /*---------------------------------------------------------------------------*/ -static int SICSIntRangeCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSIntRangeCallback(pHdb node, void *userData, + pHdbMessage message){ char buffer[256]; pHdbIntRange range = NULL; SConnection *pCon = NULL; int status = 1; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } range = (pHdbIntRange)userData; - pCon = (SConnection *)callData; + pCon = (SConnection *)mm->callData; assert(range != NULL); - if(v.v.intValue > range->max || v.v.intValue < range->min) { + if(mm->v->v.intValue > range->max || mm->v->v.intValue < range->min) { status = SICSCBRANGE; if(pCon != NULL){ snprintf(buffer,255,"ERROR: %d is not within permitted range: %d to %d", - (int)v.v.intValue, range->min, range->max); + (int)mm->v->v.intValue, range->min, range->max); SCWrite(pCon,buffer,eError); } + return hdbAbort; } - return status; + return hdbContinue; } /*---------------------------------------------------------------------------*/ pHdbCallback MakeIntRangeCallback(int min, int max){ @@ -565,7 +743,7 @@ pHdbCallback MakeIntRangeCallback(int min, int max){ range->min = min; range->max = max; return MakeHipadabaCallback(SICSIntRangeCallback, range, - free,-1,NULL); + free); } /*---------------------------------------------------------------------------*/ typedef struct { @@ -573,27 +751,33 @@ typedef struct { double max; }hdbFloatRange, *pHdbFloatRange; /*---------------------------------------------------------------------------*/ -static int SICSFloatRangeCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSFloatRangeCallback(pHdb node, void *userData, + pHdbMessage message){ char buffer[256]; pHdbFloatRange range = NULL; SConnection *pCon = NULL; int status = 1; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } range = (pHdbFloatRange)userData; - pCon = (SConnection *)callData; + pCon = (SConnection *)mm->callData; assert(range != NULL); - if(v.v.doubleValue > range->max || v.v.doubleValue < range->min) { + if(mm->v->v.doubleValue > range->max || mm->v->v.doubleValue < range->min) { status = SICSCBRANGE; if(pCon != NULL){ snprintf(buffer,255,"ERROR: %lf is not within permitted range: %lf to %lf", - v.v.doubleValue, range->min, range->max); + mm->v->v.doubleValue, range->min, range->max); SCWrite(pCon,buffer,eError); } + return hdbAbort; } - return status; + return hdbContinue; } /*---------------------------------------------------------------------------*/ pHdbCallback MakeFloatRangeCallback(double min, double max){ @@ -606,24 +790,17 @@ pHdbCallback MakeFloatRangeCallback(double min, double max){ range->min = min; range->max = max; return MakeHipadabaCallback(SICSFloatRangeCallback, range, - free,-1,NULL); -} -/*-------------------------------------------------------------------------*/ -static int MemReadCallback(void *userData, void *callData, pHdb node, - hdbValue v){ - float *value = NULL; - - value = (float *)userData; - if(value != NULL){ - v.dataType = HIPFLOAT; - v.v.doubleValue = (float) *value; - node->value.v.doubleValue = (double)*value; - } - return 1; + free); } /*------------------------------------------------------------------------*/ -static int MemGenReadCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn MemGenReadCallback(pHdb node, void *userData, + pHdbMessage message){ + pHdbDataMessage mm = NULL; + + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } + switch(node->value.dataType){ case HIPINT: node->value.v.intValue = *(int *)userData; @@ -649,56 +826,45 @@ static int MemGenReadCallback(void *userData, void *callData, pHdb node, assert(0); break; } - return 1; + return hdbContinue; } /*-------------------------------------------------------------------------*/ pHdbCallback MakeMemGenReadCallback(void *address){ return MakeHipadabaCallback(MemGenReadCallback, address, - NULL,-1,NULL); + NULL); } /*-------------------------------------------------------------------------*/ -pHdbCallback MakeMemReadCallback(float *address){ - return MakeHipadabaCallback(MemReadCallback, address, - NULL,-1,NULL); -} -/*-------------------------------------------------------------------------*/ -static int MemSetCallback(void *userData, void *callData, pHdb node, - hdbValue v){ - float *value = NULL; - - value = (float *)userData; - if(value != NULL){ - *value = (float)v.v.doubleValue; - } - UpdateHipadabaPar(node,v,callData); - return 1; -} -/*-------------------------------------------------------------------------*/ -static int MemGenSetCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn MemGenSetCallback(pHdb node, void *userData, + pHdbMessage message){ const char *pPtr = NULL; - - if(v.dataType != node->value.dataType){ + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } + + + if(mm->v->dataType != node->value.dataType){ assert(0); return 0; } switch(node->value.dataType){ case HIPINT: - memcpy(userData,&v.v.intValue,sizeof(int)); + memcpy(userData,&mm->v->v.intValue,sizeof(int)); break; case HIPFLOAT: - memcpy(userData,&v.v.doubleValue,sizeof(double)); + memcpy(userData,&mm->v->v.doubleValue,sizeof(double)); break; case HIPTEXT: - strncpy((char *)userData,(const char *)v.v.text, + strncpy((char *)userData,(const char *)mm->v->v.text, node->value.arrayLength); break; case HIPINTAR: - memcpy(userData,&v.v.intArray,node->value.arrayLength*sizeof(int)); + memcpy(userData,&mm->v->v.intArray,node->value.arrayLength*sizeof(int)); break; case HIPFLOATAR: - memcpy(userData,&v.v.floatArray, + memcpy(userData,&mm->v->v.floatArray, node->value.arrayLength*sizeof(double)); break; default: @@ -706,18 +872,13 @@ static int MemGenSetCallback(void *userData, void *callData, pHdb node, return 0; break; } - UpdateHipadabaPar(node,v,callData); - return 1; -} -/*-------------------------------------------------------------------------*/ -pHdbCallback MakeMemSetCallback(float *address){ - return MakeHipadabaCallback(MemSetCallback, address, - NULL,-1,NULL); + UpdateHipadabaPar(node,*(mm->v),mm->callData); + return hdbContinue; } /*-------------------------------------------------------------------------*/ pHdbCallback MakeMemGenSetCallback(void *address){ - return MakeHipadabaCallback(MemSetCallback, address, - NULL,-1,NULL); + return MakeHipadabaCallback(MemGenSetCallback, address, + NULL); } /*--------------------------------------------------------------------------*/ static void killHdbValue(void *pData){ @@ -731,24 +892,29 @@ static void killHdbValue(void *pData){ free(v); } /*--------------------------------------------------------------------------*/ -static int SICSIntFixedCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn SICSIntFixedCallback(pHdb node, void *userData, + pHdbMessage message){ hdbValue *allowed = NULL; SConnection *pCon = NULL; int i; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } allowed = (hdbValue *)userData; - pCon = (SConnection *)callData; + pCon = (SConnection *)mm->callData; assert(allowed != NULL && allowed->dataType == HIPINTAR); for(i = 0; i < allowed->arrayLength; i++){ - if(v.v.intValue == allowed->v.intArray[i]){ - return 1; + if(mm->v->v.intValue == allowed->v.intArray[i]){ + return hdbContinue; } } if(pCon != NULL){ SCWrite(pCon,"ERROR: value is not in the list of allowed values",eError); } - return SICSCBBADFIXED; + return hdbAbort; } /*---------------------------------------------------------------------------*/ pHdbCallback MakeIntFixedCallback(int *data, int length){ @@ -767,7 +933,7 @@ pHdbCallback MakeIntFixedCallback(int *data, int length){ } memcpy(v->v.intArray,data,length*sizeof(int)); return MakeHipadabaCallback(SICSIntFixedCallback, v, - killHdbValue,-1,NULL); + killHdbValue); } /*============= Parameter Creation ===========================================*/ pHdb MakeSICSHdbPar(char *name, int priv, hdbValue v){ @@ -786,14 +952,14 @@ pHdb MakeSICSHdbPar(char *name, int priv, hdbValue v){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); pHcb = MakeSetUpdateCallback(); if(pHcb == NULL){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); switch(priv){ case 0: strcpy(pPriv,"internal"); @@ -833,21 +999,21 @@ pHdb MakeSICSHdbDriv(char *name, int priv, void *sicsObject, int dataType){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); pHcb = MakeSICSDriveCallback(sicsObject); if(pHcb == NULL){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); pHcb = MakeSICSReadDriveCallback(sicsObject); if(pHcb == NULL){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBREAD,pHcb); + AppendHipadabaCallback(result,pHcb); return result; } @@ -866,21 +1032,21 @@ pHdb MakeSICSMemPar(char *name, int priv, float *address){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); - pHcb = MakeMemSetCallback(address); + pHcb = MakeMemGenSetCallback(address); if(pHcb == NULL){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); - pHcb = MakeMemReadCallback(address); + pHcb = MakeMemGenReadCallback(address); if(pHcb == NULL){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBREAD,pHcb); + AppendHipadabaCallback(result,pHcb); return result; } @@ -900,7 +1066,7 @@ pHdb MakeSICSROPar(char *name, hdbValue v){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); return result; } @@ -921,14 +1087,14 @@ pHdb MakeSICSScriptPar(char *name, char *setScript, char *readScript, DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBSET,pHcb); + AppendHipadabaCallback(result,pHcb); pHcb = MakeSICSReadScriptCallback(readScript); if(pHcb == NULL){ DeleteHipadabaNode(result,NULL); return NULL; } - AppendHipadabaCallback(result,HCBREAD,pHcb); + AppendHipadabaCallback(result,pHcb); /** * put into the list of nodes to check with the update task */ @@ -971,9 +1137,7 @@ static void SICSDeleteNodeData(pHdb node){ if(node->properties != NULL){ DeleteStringDict(node->properties); } - DeleteCallbackChain(node->writeCallbacks); - DeleteCallbackChain(node->updateCallbacks); - DeleteCallbackChain(node->readCallbacks); + DeleteCallbackChain(node->callBackChain); if(node->name != NULL){ free(node->name); @@ -1038,21 +1202,21 @@ int AddSICSHdbMemPar(pHdb node, char *name, int priv, DeleteHipadabaNode(child,NULL); return 0; } - AppendHipadabaCallback(child,HCBSET,pHcb); + AppendHipadabaCallback(child,pHcb); pHcb = MakeMemGenSetCallback(data); if(pHcb == NULL){ DeleteHipadabaNode(child,NULL); return 0; } - AppendHipadabaCallback(child,HCBSET,pHcb); + AppendHipadabaCallback(child,pHcb); pHcb = MakeMemGenReadCallback(data); if(pHcb == NULL){ DeleteHipadabaNode(child,NULL); return 0; } - AppendHipadabaCallback(child,HCBREAD,pHcb); + AppendHipadabaCallback(child,pHcb); AddHipadabaChild(node,child,NULL); return 1; @@ -1206,15 +1370,23 @@ int GetHdbPath(pHdb nodeArg, char *path, size_t pathlen) { } /*--------------------------------------------------------------------------*/ static int RemoveParNodeCallback(char *name, pDummy object, void *internalID) { - if (object->pDescriptor->parNode) { - InternalRemoveHipadabaCallback(object->pDescriptor->parNode, internalID); - } - return 1; + hdbPtrMessage m; + + m.type = killPtr; + m.pPtr = internalID; + if (object->pDescriptor->parNode) { + InvokeCallbackChain(object->pDescriptor->parNode,(pHdbMessage)&m); + } + return 1; } /*--------------------------------------------------------------------------*/ void RemoveSICSInternalCallback(void *internalID) { - InternalRemoveHipadabaCallback(GetHipadabaRoot(), internalID); - ForEachCommand(RemoveParNodeCallback, internalID); + hdbPtrMessage m; + + m.type = killPtr; + m.pPtr = internalID; + InvokeCallbackChain(GetHipadabaRoot(),(pHdbMessage)&m); + ForEachCommand(RemoveParNodeCallback, internalID); } /*--------------------------------------------------------------------------*/ int SICSHdbGetPar(void *obj, SConnection *pCon, @@ -1326,8 +1498,8 @@ int InstallSICSNotify(pHdb node, SConnection *pCon, int id, int recurse){ SCWrite(pCon,"ERROR: out of memory installing callback", eError); return 0; } - AppendHipadabaCallback(node, HCBUPDATE, noty); - AppendHipadabaCallback(node, HCBTREE, treeChange); + AppendHipadabaCallback(node, noty); + AppendHipadabaCallback(node, treeChange); if(recurse == 1){ currentChild = node->child; @@ -1339,6 +1511,14 @@ int InstallSICSNotify(pHdb node, SConnection *pCon, int id, int recurse){ return 1; } /*---------------------------------------------------------------------------*/ +void RemoveConnectionCallbacks(pHdb root, SConnection *pCon){ + hdbPtrMessage dsm; + + dsm.type = killPtr; + dsm.pPtr = pCon; + RecurseCallbackChains(root,(pHdbMessage)&dsm); +} +/*---------------------------------------------------------------------------*/ int ProcessSICSHdbPar(pHdb root, SConnection *pCon, char *printPrefix, int argc, char *argv[]){ hdbValue input; @@ -2176,7 +2356,7 @@ static int HdbNodeVal(SConnection *pCon, SicsInterp *pSics, void *pData, int isSICSHdbRO(pHdb node){ pHdbCallback current = NULL; - current = node->writeCallbacks; + current = node->callBackChain; while(current != NULL){ if(current->userCallback == SICSReadOnlyCallback) { return 1; @@ -2427,6 +2607,7 @@ static int AutoNotifyHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, static int RemoveHdbCallback(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]){ int id; + hdbIDMessage m; if(argc < 2) { SCWrite(pCon,"ERROR: need callback id to remove", @@ -2434,7 +2615,9 @@ static int RemoveHdbCallback(SConnection *pCon, SicsInterp *pSics, void *pData, return 0; } id = atoi(argv[1]); - RemoveHipadabaCallback(root,id); + m.type = killID; + m.ID = id; + InvokeCallbackChain(root,(pHdbMessage)&m); SCSendOK(pCon); return 1; } @@ -2496,18 +2679,23 @@ static int LinkHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, return 1; } /*-------------------------------------------------------------------------*/ -static int ChainCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn ChainCallback(pHdb node, void *userData, + pHdbMessage message){ pHdb slave = (pHdb)userData; hdbValue vv, old; + pHdbDataMessage mm = NULL; + + if((mm = GetHdbUpdateMessage(message)) == NULL){ + return hdbContinue; + } if(slave != NULL){ memset(&vv,0,sizeof(hdbValue)); - GetHipadabaPar(slave,&vv,callData); - UpdateHipadabaPar(slave, vv, callData); + GetHipadabaPar(slave,&vv,mm->callData); + UpdateHipadabaPar(slave, vv, mm->callData); ReleaseHdbValue(&vv); } - return 1; + return hdbContinue; } /*--------------------------------------------------------------------------*/ static int ChainHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, @@ -2538,12 +2726,12 @@ static int ChainHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, return 0; } - kalle = MakeHipadabaCallback(ChainCallback,slave, NULL, -1,NULL); + kalle = MakeHipadabaCallback(ChainCallback,slave, NULL); if(kalle == NULL){ SCWrite(pCon,"ERROR: out of memory creating callback",eError); return 0; } - AppendHipadabaCallback(master,HCBUPDATE, kalle); + AppendHipadabaCallback(master,kalle); SCSendOK(pCon); return 1; } @@ -2595,16 +2783,24 @@ static int ChainHdbNode(SConnection *pCon, SicsInterp *pSics, void *pData, return iRet; } /*---------------------------------------------------------------------------*/ -static int CommandSetCallback(void *userData, void *callData, pHdb node, - hdbValue v){ - SConnection *pCon = (SConnection *)callData; +static hdbCallbackReturn CommandSetCallback(pHdb node, void *userData, + pHdbMessage message){ + SConnection *pCon = NULL; pDynString cmd = NULL, par = NULL; pHdb current = NULL; int status; + pHdbDataMessage mm = NULL; + hdbValue v; + + if((mm = GetHdbSetMessage(message)) == NULL){ + return hdbContinue; + } + pCon = (SConnection *)pCon; + v = *(mm->v); if(pCon == NULL){ printf("Cannot invoke command without connection\n"); - return 0; + return hdbAbort; } if(v.dataType == HIPTEXT){ @@ -2628,20 +2824,30 @@ static int CommandSetCallback(void *userData, void *callData, pHdb node, } status = HDBInvoke(pCon,pServ->pSics, GetCharArray(cmd)); DeleteDynString(cmd); - return status; + if(status == 1){ + return hdbContinue; + } else { + return hdbAbort; + } } else { SCWrite(pCon,"ERROR: this node only understands start as value",eError); - return 0; + return hdbAbort; } } - return 0; + return hdbContinue; } /*---------------------------------------------------------------------------*/ -static int CommandGetCallback(void *userData, void *callData, pHdb node, - hdbValue v){ +static hdbCallbackReturn CommandGetCallback(pHdb node, void *userData, + pHdbMessage message){ + pHdbDataMessage mm = NULL; + + if((mm = GetHdbGetMessage(message)) == NULL){ + return hdbContinue; + } + hdbValue v2 = MakeHdbText("Nothing to get"); - v = v2; - return 1; + *(mm->v) = v2; + return hdbContinue; } /*--------------------------------------------------------------------------*/ static int SicsCommandNode(SConnection *pCon, SicsInterp *pSics, void *pData, @@ -2671,19 +2877,19 @@ static int SicsCommandNode(SConnection *pCon, SicsInterp *pSics, void *pData, node->value.arrayLength = strlen(argv[2]); SetHdbProperty(node,"sicscommand", argv[2]); - kalle = MakeHipadabaCallback(CommandSetCallback,NULL, NULL, -1,NULL); + kalle = MakeHipadabaCallback(CommandSetCallback,NULL, NULL); if(kalle == NULL){ SCWrite(pCon,"ERROR: out of memory in hcommand",eError); return 0; } - AppendHipadabaCallback(node,HCBSET, kalle); + AppendHipadabaCallback(node,kalle); - kalle = MakeHipadabaCallback(CommandGetCallback,NULL, NULL, -1,NULL); + kalle = MakeHipadabaCallback(CommandGetCallback,NULL, NULL); if(kalle == NULL){ SCWrite(pCon,"ERROR: out of memory in hcommand",eError); return 0; } - AppendHipadabaCallback(node,HCBREAD, kalle); + AppendHipadabaCallback(node,kalle); AddHipadabaChild(parent,node,pCon); diff --git a/sicshipadaba.h b/sicshipadaba.h index 42c0c0bc..c87e2c69 100644 --- a/sicshipadaba.h +++ b/sicshipadaba.h @@ -18,6 +18,21 @@ #define SICSCBRANGE -609 #define SICSCBBADFIXED -610 #define SICSNOPAR -611 +/*======================== SICS Messages ======================================*/ +typedef struct { + char *type; + int ID; +}hdbIDMessage, *pHdbIDMessage; +/*------------------------------------------------------------------------------*/ +pHdbIDMessage GetKillIDMessage(pHdbMessage message); +pHdbIDMessage GetKillInternalIDMessage(pHdbMessage message); +/*-----------------------------------------------------------------------------*/ +typedef struct { + char *type; + void *pPtr; +}hdbPtrMessage, *pHdbPtrMessage; +/*-----------------------------------------------------------------------------*/ +pHdbPtrMessage GetKillPtrMessage(pHdbMessage message); /*======================== data structure for automatic parameter update =======*/ typedef struct { SConnection *pCon; @@ -341,6 +356,12 @@ int isSICSHdbRO(pHdb node); * @return 1 on success, 0 when out of memory. */ int InstallSICSNotify(pHdb node, SConnection *pCon, int id, int recurse); +/** + * remove all Callbacks associated with a given conenction + * @param root Where to start removing callbacks + * @param pCon The connection for which to remove callbacks + */ +void RemoveConnectionCallbacks(pHdb root, SConnection *pCon); /** * handles the common task of checking for, and processing a SICS parameter. * @param root The node at which to search for parameters diff --git a/sicsobj.c b/sicsobj.c index 87019365..17ec2625 100644 --- a/sicsobj.c +++ b/sicsobj.c @@ -203,7 +203,7 @@ static int MakeScriptFunc(pSICSOBJ self, SConnection *pCon, node->value.v.obj = ScriptObjFunc; SetHdbProperty(node,"script",argv[3]); SetHdbProperty(node,"priv",argv[4]); - AppendHipadabaCallback(node,HCBSET,MakeSICSFuncCallback(self)); + AppendHipadabaCallback(node,MakeSICSFuncCallback(self)); AddHipadabaChild(parent,node,pCon); SCSendOK(pCon); return 1; diff --git a/val.lis b/val.lis index 7b04a358..de5d80ce 100644 --- a/val.lis +++ b/val.lis @@ -1,240 +1,553 @@ -==19540== Memcheck, a memory error detector. -==19540== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. -==19540== Using LibVEX rev 1732, a library for dynamic binary translation. -==19540== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. -==19540== Using valgrind-3.2.3, a dynamic binary instrumentation framework. -==19540== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. -==19540== For more details, rerun with: -v -==19540== -==19540== Syscall param write(buf) points to uninitialised byte(s) -==19540== at 0x41DA1FE: __write_nocancel (in /lib/tls/libc-2.3.2.so) -==19540== by 0x81D25BD: H5FD_sec2_write (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== Address 0xBEFF3BFA is on thread 1's stack -==19540== -==19540== Source and destination overlap in memcpy(0x4445028, 0x43CE7E8, 1744896) -==19540== at 0x401C96D: memcpy (mc_replace_strmem.c:116) -==19540== by 0x8241BDA: H5V_memcpyvv (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Invalid read of size 1 -==19540== at 0x401C988: memcpy (mc_replace_strmem.c:406) -==19540== by 0x8241BDA: H5V_memcpyvv (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== Address 0x4445027 is 1 bytes before a block of size 1,744,896 alloc'd -==19540== at 0x401A846: malloc (vg_replace_malloc.c:149) -==19540== by 0x81B8BDE: H5D_istore_chunk_alloc (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Invalid read of size 1 -==19540== at 0x401C98D: memcpy (mc_replace_strmem.c:406) -==19540== by 0x8241BDA: H5V_memcpyvv (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== Address 0x4445026 is 2 bytes before a block of size 1,744,896 alloc'd -==19540== at 0x401A846: malloc (vg_replace_malloc.c:149) -==19540== by 0x81B8BDE: H5D_istore_chunk_alloc (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Invalid read of size 1 -==19540== at 0x401C993: memcpy (mc_replace_strmem.c:406) -==19540== by 0x8241BDA: H5V_memcpyvv (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== Address 0x4445025 is 3 bytes before a block of size 1,744,896 alloc'd -==19540== at 0x401A846: malloc (vg_replace_malloc.c:149) -==19540== by 0x81B8BDE: H5D_istore_chunk_alloc (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Invalid read of size 1 -==19540== at 0x401C99A: memcpy (mc_replace_strmem.c:406) -==19540== by 0x8241BDA: H5V_memcpyvv (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== Address 0x4445024 is 4 bytes before a block of size 1,744,896 alloc'd -==19540== at 0x401A846: malloc (vg_replace_malloc.c:149) -==19540== by 0x81B8BDE: H5D_istore_chunk_alloc (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D60F5: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D609F: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D60FE: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D60D8: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D6107: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D6110: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Use of uninitialised value of size 4 -==19540== at 0x40D68E5: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Use of uninitialised value of size 4 -==19540== at 0x40D68F7: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Use of uninitialised value of size 4 -==19540== at 0x40D6B50: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Use of uninitialised value of size 4 -==19540== at 0x40D6B65: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D60DF: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D60E8: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D6119: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D6122: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D612B: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) -==19540== -==19540== Conditional jump or move depends on uninitialised value(s) -==19540== at 0x40D6134: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D6945: (within /usr/lib/libz.so.1.1.4) -==19540== by 0x40D598F: deflate (in /usr/lib/libz.so.1.1.4) -==19540== by 0x40D3C7F: compress2 (in /usr/lib/libz.so.1.1.4) -==19540== by 0x8243947: H5Z_filter_deflate (in /afs/psi.ch/user/k/koennecke/src/workspace/sics/SICServer) +==3348== Memcheck, a memory error detector. +==3348== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. +==3348== Using LibVEX rev 1658, a library for dynamic binary translation. +==3348== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. +==3348== Using valgrind-3.2.1, a dynamic binary instrumentation framework. +==3348== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. +==3348== For more details, rerun with: -v +==3348== WARNING: Cannot log(Accepted dummy connection ) -sim/laue/laue.tcl:0>> ServerOption ReadTimeOut 10 -sim/laue/laue.tcl:1>> ServerOption AcceptTimeOut 10 -sim/laue/laue.tcl:2>> ServerOption ReadUserPasswdTimeout 500000 -sim/laue/laue.tcl:3>> ServerOption ServerPort 2911 -sim/laue/laue.tcl:4>> ServerOption InterruptPort 2913 -sim/laue/laue.tcl:5>> ServerOption TelnetPort 1301 -sim/laue/laue.tcl:6>> ServerOption TelWord sicslogin -sim/laue/laue.tcl:7>> ServerOption QuieckPort 2108 -sim/laue/laue.tcl:8>> TokenInit connan -sim/laue/laue.tcl:9>> ServerOption LogFileDir $loghome -sim/laue/laue.tcl:10>> commandlog auto -sim/laue/laue.tcl:11>> ServerOption statusfile $datahome/lauestatus.tcl -sim/laue/laue.tcl:12>> SicsUser Mugger Mugger 1 -sim/laue/laue.tcl:13>> SicsUser lnsmanager lnsSICSlns 1 -sim/laue/laue.tcl:14>> SicsUser User User 2 -sim/laue/laue.tcl:15>> SicsUser Spy Spy 3 -sim/laue/laue.tcl:16>> SicsUser laueuser 07lns1 2 -sim/laue/laue.tcl:17>> VarMake Instrument Text Internal -sim/laue/laue.tcl:18>> VarMake sample Text User -sim/laue/laue.tcl:19>> sample " " -sim/laue/laue.tcl:20>> VarMake Title Text User -sim/laue/laue.tcl:21>> Title " " -sim/laue/laue.tcl:22>> VarMake User Text User -sim/laue/laue.tcl:23>> User " " -sim/laue/laue.tcl:24>> VarMake email Text User -sim/laue/laue.tcl:25>> email "unknown" -sim/laue/laue.tcl:26>> VarMake address Text User -sim/laue/laue.tcl:27>> address "unknown" -sim/laue/laue.tcl:28>> VarMake fax Text User -sim/laue/laue.tcl:29>> fax "unknown" -sim/laue/laue.tcl:30>> VarMake phone Text User -sim/laue/laue.tcl:31>> phone "unknown" -sim/laue/laue.tcl:32>> hm configure counter counter -sim/laue/laue.tcl:33>> hm configure amplictrl 1 -sim/laue/laue.tcl:34>> hm configure shutterctrl 2 -sim/laue/laue.tcl:35>> hm configure clear 1 -sim/laue/laue.tcl:36>> hm configure rank 2 -sim/laue/laue.tcl:37>> hm configure dim0 768 -sim/laue/laue.tcl:38>> hm configure dim1 568 -sim/laue/laue.tcl:39>> sicsdatafactory new __transfer -sim/laue/laue.tcl:40>> MakeSicsObj lscan LaueScan -sim/laue/laue.tcl:41>> hmake /sics/lscan/upperpos mugger float -sim/laue/laue.tcl:42>> hmake /sics/lscan/lowerpos mugger float -sim/laue/laue.tcl:43>> hmake /sics/lscan/sttbegin user float -sim/laue/laue.tcl:44>> hmake /sics/lscan/sttend user float -sim/laue/laue.tcl:45>> hmake /sics/lscan/sttstep user float -sim/laue/laue.tcl:46>> hcommand /sics/lscan/run lauescan -sim/laue/laue.tcl:47>> hsetprop /sics/lscan/run type command -sim/laue/laue.tcl:48>> hsetprop /sics/lscan/run priv user -sim/laue/laue.tcl:49>> hmake /sics/lscan/run/mode user text -sim/laue/laue.tcl:50>> hmake /sics/lscan/run/preset user float -sim/laue/laue.tcl:51>> hset /sics/lscan/upperpos 190. -sim/laue/laue.tcl:52>> hset /sics/lscan/lowerpos 5. -sim/laue/laue.tcl:53>> hset /sics/lscan/sttbegin 10. -sim/laue/laue.tcl:54>> hset /sics/lscan/sttend 30. -sim/laue/laue.tcl:55>> hset /sics/lscan/sttstep 5. -sim/laue/laue.tcl:56>> hset /sics/lscan/run/mode timer -sim/laue/laue.tcl:57>> hset /sics/lscan/run/preset 2. -sim/laue/laue.tcl:58>> MakeDataNumber SicsDataNumber $datahome/DataNumber -sim/laue/laue.tcl:59>> VarMake SicsDataPath Text Mugger -sim/laue/laue.tcl:60>> SicsDataPath $datahome/ -sim/laue/laue.tcl:61>> SicsDataPath lock -sim/laue/laue.tcl:62>> VarMake SicsDataPrefix Text Mugger -sim/laue/laue.tcl:63>> SicsDataPrefix laue -sim/laue/laue.tcl:64>> SicsDataPrefix lock -sim/laue/laue.tcl:65>> VarMake SicsDataPostFix Text Mugger -sim/laue/laue.tcl:66>> SicsDataPostFix .hdf -sim/laue/laue.tcl:67>> SicsDataPostFix lock -sim/laue/laue.tcl:68>> clientput "Laue configuration done" -Laue configuration done +sim/topsi/morpheus.tcl:0>> ServerOption ReadTimeOut 10 +sim/topsi/morpheus.tcl:1>> ServerOption AcceptTimeOut 50 +sim/topsi/morpheus.tcl:2>> ServerOption ReadUserPasswdTimeout 500000 +sim/topsi/morpheus.tcl:3>> ServerOption LogFileBaseName $loghome/morpheus +sim/topsi/morpheus.tcl:4>> ServerOption TecsPort 9753 +sim/topsi/morpheus.tcl:5>> ServerOption ServerPort 2911 +sim/topsi/morpheus.tcl:6>> ServerOption InterruptPort 9709 +sim/topsi/morpheus.tcl:7>> ServerOption statusfile $datahome/morpheusstatus.tcl +sim/topsi/morpheus.tcl:8>> ServerOption TelnetPort 1301 +sim/topsi/morpheus.tcl:9>> ServerOption TelWord sicslogin +sim/topsi/morpheus.tcl:10>> ServerOption QuieckPort 2108 +sim/topsi/morpheus.tcl:11>> TokenInit connan +sim/topsi/morpheus.tcl:12>> ServerOption LogFileDir $loghome +sim/topsi/morpheus.tcl:13>> commandlog auto +sim/topsi/morpheus.tcl:14>> ServerOption RedirectFile $loghome/mostdout +sim/topsi/morpheus.tcl:15>> MakeDataNumber SicsDataNumber $datahome/DataNumber +sim/topsi/morpheus.tcl:16>> VarMake SicsDataPath Text Mugger +sim/topsi/morpheus.tcl:17>> SicsDataPath $datahome/ +sim/topsi/morpheus.tcl:18>> SicsDataPath lock +sim/topsi/morpheus.tcl:19>> VarMake SicsDataPrefix Text Mugger +sim/topsi/morpheus.tcl:20>> SicsDataPrefix lock +sim/topsi/morpheus.tcl:21>> VarMake SicsDataPostFix Text Mugger +sim/topsi/morpheus.tcl:22>> SicsDataPostFix .dat +sim/topsi/morpheus.tcl:23>> SicsDataPostFix lock +sim/topsi/morpheus.tcl:24>> SicsUser lnsmanager lnsSICSlns 1 +sim/topsi/morpheus.tcl:25>> SicsUser morpheususer 07lns1 2 +sim/topsi/morpheus.tcl:26>> SicsUser mu 07lns1 2 +sim/topsi/morpheus.tcl:27>> SicsUser User 07lns1 2 +sim/topsi/morpheus.tcl:28>> VarMake Instrument Text Internal +sim/topsi/morpheus.tcl:29>> VarMake sample Text User +sim/topsi/morpheus.tcl:30>> sample " " +sim/topsi/morpheus.tcl:31>> VarMake Title Text User +sim/topsi/morpheus.tcl:32>> Title "morpheus" +sim/topsi/morpheus.tcl:33>> VarMake User Text User +sim/topsi/morpheus.tcl:34>> User "unknown" +sim/topsi/morpheus.tcl:35>> VarMake email Text User +sim/topsi/morpheus.tcl:36>> email "unknown" +sim/topsi/morpheus.tcl:37>> VarMake adress Text User +sim/topsi/morpheus.tcl:38>> adress "unknown" +sim/topsi/morpheus.tcl:39>> VarMake fax Text User +sim/topsi/morpheus.tcl:40>> fax "unknown" +sim/topsi/morpheus.tcl:41>> VarMake phone Text User +sim/topsi/morpheus.tcl:42>> phone "unknown" +sim/topsi/morpheus.tcl:43>> VarMake BatchRoot text User +sim/topsi/morpheus.tcl:44>> VarMake lastscancommand Text User +sim/topsi/morpheus.tcl:45>> lastscancommand "unknown scan" +sim/topsi/morpheus.tcl:46>> VarMake window Text User +sim/topsi/morpheus.tcl:47>> window 0:256:0:256 +sim/topsi/morpheus.tcl:48>> Publish savemotorpar Mugger +sim/topsi/morpheus.tcl:49>> SicsAlias STH A3 +sim/topsi/morpheus.tcl:50>> SicsAlias STH SOM +sim/topsi/morpheus.tcl:51>> SicsAlias STH TH +sim/topsi/morpheus.tcl:52>> SicsAlias STH OM +sim/topsi/morpheus.tcl:53>> SicsAlias STT A4 +sim/topsi/morpheus.tcl:54>> SicsAlias STT S2T +sim/topsi/morpheus.tcl:55>> SicsAlias STT TTH +sim/topsi/morpheus.tcl:56>> SicsAlias STT 2T +sim/topsi/morpheus.tcl:57>> SicsAlias SCX SCH +sim/topsi/morpheus.tcl:58>> SicsAlias SCX CHI +sim/topsi/morpheus.tcl:59>> SicsAlias SCY SPH +sim/topsi/morpheus.tcl:60>> SicsAlias SCY PHI +sim/topsi/morpheus.tcl:61>> SicsAlias SCY ATX +sim/topsi/morpheus.tcl:62>> SicsAlias PO1 POL +sim/topsi/morpheus.tcl:63>> SicsAlias PO2 ANA +sim/topsi/morpheus.tcl:64>> SicsAlias MTH A1 +sim/topsi/morpheus.tcl:65>> SicsAlias MTH MOM +sim/topsi/morpheus.tcl:66>> SicsAlias MTT A2 +sim/topsi/morpheus.tcl:67>> SicsAlias MTT M2T +sim/topsi/morpheus.tcl:68>> SicsAlias MFV MCV +sim/topsi/morpheus.tcl:69>> MakeLin2Ang sttl utt +sim/topsi/morpheus.tcl:70>> sttl length 2110 +sim/topsi/morpheus.tcl:71>> SicsAlias sttl u2t +sim/topsi/morpheus.tcl:72>> Publish motransfer Spy +sim/topsi/morpheus.tcl:73>> MakeO2T O2T sth stt +sim/topsi/morpheus.tcl:74>> MakeO2T O2TL sth sttl +sim/topsi/morpheus.tcl:75>> MakeO2T O2U sth sttl +sim/topsi/morpheus.tcl:76>> MakeScanCommand xxxscan counter $scripthome/morpheus.hdd \ + $loghome/recover.bin +sim/topsi/morpheus.tcl:77>> MakePeakCenter xxxscan +sim/topsi/morpheus.tcl:78>> MakeOptimise opti counter +sim/topsi/morpheus.tcl:79>> SicsAlias drive dr +sim/topsi/morpheus.tcl:80>> MakeHKL stt sth sch sph +sim/topsi/morpheus.tcl:81>> MakeHKLMot hkl +sim/topsi/morpheus.tcl:82>> MakeUBCalc ubcalc hkl +sim/topsi/morpheus.tcl:83>> MakeCone cone ubcalc +sim/topsi/morpheus.tcl:84>> hkl lambdavar lambda +sim/topsi/morpheus.tcl:85>> MakeXYTable table +sim/topsi/morpheus.tcl:86>> MakeConfigurableMotor two +sim/topsi/morpheus.tcl:87>> two drivescript twoscript +ERROR: duplicate exe manager not created +sim/topsi/morpheus.tcl:88>> fileeval $scripthome/morpheuscom.tcl +ERROR: new SICSData not created due to name collision +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:89>> MakeStateMon xxxscan +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:90>> hmake /instrument spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:91>> hsetprop /instrument type instrument +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:92>> hmake /graphics spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:93>> hsetprop /graphics type graphset +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:94>> hattach /instrument title title +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:95>> hmake /instrument/user spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:96>> hsetprop /instrument/user type dev +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:97>> hattach /instrument/user user name +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:98>> hattach /instrument/user adress address +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:99>> hattach /instrument/user phone phone +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:100>> hattach /instrument/user email email +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:101>> hmake /instrument/user/flame user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:102>> hset /instrument/user/flame "This user is a DAU" +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:103>> hsetprop /instrument/user/flame visible false +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:104>> hmake /instrument/monochromator spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:105>> hsetprop /instrument/monochromator type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:106>> hattach /instrument/monochromator lambda wavelength +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:107>> hchain /instrument/monochromator/wavelength /instrument/monochromator/two_theta +ERROR: master /instrument/monochromator/wavelength not found +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:108>> hattach /instrument/monochromator mth theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:109>> hattach /instrument/monochromator mtt two_theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:110>> hattach /instrument/monochromator mtx x_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:111>> hattach /instrument/monochromator mty y_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:112>> hattach /instrument/monochromator mfv vertical_focusing +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:113>> hmake /instrument/slit1 spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:114>> hsetprop /instrument/slit1 type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:115>> hattach /instrument/slit1 d1l left +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:116>> hattach /instrument/slit1 d1r right +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:117>> hattach /instrument/slit1 d1t top +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:118>> hattach /instrument/slit1 d1b bottom +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:119>> hmake /instrument/slit2 spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:120>> hsetprop /instrument/slit2 type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:121>> hattach /instrument/slit2 d2l left +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:122>> hattach /instrument/slit2 d2r right +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:123>> hattach /instrument/slit2 d2t top +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:124>> hattach /instrument/slit2 d2b bottom +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:125>> hmake /instrument/sample spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:126>> hsetprop /instrument/sample type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:127>> hattach /instrument/sample sample name +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:128>> hattach /instrument/sample sth omega +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:129>> hattach /instrument/sample stt two_theta +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:130>> hattach /instrument/sample stx x_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:131>> hattach /instrument/sample sty y_translation +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:132>> hattach /instrument/sample sgy y_goniometer +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:133>> hattach /instrument/sample sgx x_goniometer +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:134>> hmake /instrument/monitor spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:135>> hsetprop /instrument/monitor type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:136>> hmake /instrument/monitor/counts internal int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:137>> hattach /instrument/monitor/counts counter 1 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:138>> hsetprop /instrument/monitor/counts priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:139>> hsetprop /instrument/monitor/counts sicsdev counter +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:140>> hmakescript /instrument/monitor/preset "counter getpreset" "counter setpreset" float +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:141>> hmakescript /instrument/monitor/countmode "counter getmode" "counter setmode" text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:142>> hmake /instrument/counter spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:143>> hsetprop /instrument/counter type part +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:144>> hmake /instrument/counter/counts internal int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:145>> hattach /instrument/counter/counts counter 0 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:146>> hsetprop /instrument/counter/counts priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:147>> hmake /gui spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:148>> hmake /gui/status internal text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:149>> status hdbinterest /gui/status +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:150>> hmake /graphics/scan_data spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:151>> hsetprop /graphics/scan_data type graphdata +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:152>> hsetprop /graphics/scan_data viewer default +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:153>> hmake /graphics/scan_data/rank mugger int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:154>> hset /graphics/scan_data/rank 1 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:155>> hsetprop /graphics/scan_data/rank priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:156>> hmakescript /graphics/scan_data/dim "xxxscan np" hdbReadOnly intar 1 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:157>> hsetprop /graphics/scan_data/dim priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:158>> hmakescript /graphics/scan_data/scan_variable "gethdbscanvardata 0" hdbReadOnly floatvarar 1 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:159>> hsetprop /graphics/scan_data/scan_variable type axis +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:160>> hsetprop /graphics/scan_data/scan_variable dim 0 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:161>> hsetprop /graphics/scan_data/scan_variable transfer zip +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:162>> hsetprop /graphics/scan_data/scan_variable priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:163>> hmakescript /graphics/scan_data/counts "gethdbscancounts" hdbReadOnly intvarar 1 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:164>> hsetprop /graphics/scan_data/counts type data +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:165>> hsetprop /graphics/scan_data/counts transfer zip +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:166>> hsetprop /graphics/scan_data/counts priv internal +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:167>> hmake /instrument/commands spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:168>> hsetprop /instrument/commands type commandset +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:169>> hcommand /instrument/commands/scan hdbscan +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:170>> hsetprop /instrument/commands/scan type command +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:171>> hsetprop /instrument/commands/scan priv user +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:172>> hmake /instrument/commands/scan/scan_variables user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:173>> hsetprop /instrument/commands/scan/scan_variables argtype drivable +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:174>> hmake /instrument/commands/scan/scan_start user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:175>> hmake /instrument/commands/scan/scan_increments user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:176>> hmake /instrument/commands/scan/NP user int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:177>> hmake /instrument/commands/scan/mode user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:178>> hsetprop /instrument/commands/scan/mode values "monitor,timer" +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:179>> hmake /instrument/commands/scan/preset user float +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:180>> hcommand /instrument/commands/graphscan hdbscan +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:181>> hsetprop /instrument/commands/graphscan type command +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:182>> hsetprop /instrument/commands/graphscan viewer mountaingumui.ScanEditor +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:183>> hsetprop /instrument/commands/graphscan priv user +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:184>> hmake /instrument/commands/graphscan/scan_variables user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:185>> hsetprop /instrument/commands/graphscan/scan_variables argtype drivable +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:186>> hmake /instrument/commands/graphscan/scan_start user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:187>> hmake /instrument/commands/graphscan/scan_increments user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:188>> hmake /instrument/commands/graphscan/NP user int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:189>> hmake /instrument/commands/graphscan/mode user text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:190>> hsetprop /instrument/commands/graphscan/mode values "monitor,timer" +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:191>> hmake /instrument/commands/graphscan/preset user float +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:192>> hcommand /instrument/commands/wait wait +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:193>> hsetprop /instrument/commands/wait type command +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:194>> hsetprop /instrument/commands/wait priv user +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:195>> hmake /instrument/commands/wait/time user int +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:196>> hmake /quickview spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:197>> hmake /batch spy none +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:198>> hmakescript /batch/bufferlist listbatchfiles hdbReadOnly text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:199>> sicspoll add /batch/bufferlist hdb 30 +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:200>> hmake /batch/commandtext spy text +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:201>> hsetprop /batch/commandtext viewer mountaingumui.TextEdit +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:202>> hsetprop /batch/commandtext commandtext true +/afs/psi.ch/user/k/koennecke/src/workspace/sics/sim/topsi/morpheuscom.tcl:203>> __filemode prehistoric OK -ERROR: alias daba not recognized -OK -==19540== -==19540== ERROR SUMMARY: 4310127 errors from 22 contexts (suppressed: 29 from 3) -==19540== malloc/free: in use at exit: 73,818 bytes in 1,540 blocks. -==19540== malloc/free: 14,838 allocs, 13,298 frees, 5,407,018 bytes allocated. -==19540== For counts of detected errors, rerun with: -v -==19540== searching for pointers to 1,540 not-freed blocks. -==19540== checked 479,156 bytes. -==19540== -==19540== LEAK SUMMARY: -==19540== definitely lost: 69 bytes in 6 blocks. -==19540== possibly lost: 8,000 bytes in 1 blocks. -==19540== still reachable: 65,749 bytes in 1,533 blocks. -==19540== suppressed: 0 bytes in 0 blocks. -==19540== Rerun with --leak-check=full to see details of leaked memory. +==3348== Invalid read of size 1 +==3348== at 0x400630E: strcmp (mc_replace_strmem.c:341) +==3348== by 0x80FE3D1: compareHdbValue (hipadaba.c:482) +==3348== by 0x81140E4: pollHdb (polldriv.c:38) +==3348== by 0x811459A: PollTask (sicspoll.c:135) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== by 0x8057A25: RunServer (nserver.c:406) +==3348== by 0x8057F27: main (SICSmain.c:62) +==3348== Address 0x4CC7A38 is 0 bytes inside a block of size 8 free'd +==3348== at 0x4004FDA: free (vg_replace_malloc.c:233) +==3348== by 0x81039B1: readHdbValue (sicshipadaba.c:1797) +==3348== by 0x81010AF: SICSScriptReadCallback (sicshipadaba.c:683) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF222: GetHipadabaPar (hipadaba.c:940) +==3348== by 0x8114091: pollHdb (polldriv.c:37) +==3348== by 0x811459A: PollTask (sicspoll.c:135) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== by 0x8057A25: RunServer (nserver.c:406) +==3348== by 0x8057F27: main (SICSmain.c:62) +==3348== +==3348== Invalid read of size 1 +==3348== at 0x400632E: strcmp (mc_replace_strmem.c:341) +==3348== by 0x80FE3D1: compareHdbValue (hipadaba.c:482) +==3348== by 0x81140E4: pollHdb (polldriv.c:38) +==3348== by 0x811459A: PollTask (sicspoll.c:135) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== by 0x8057A25: RunServer (nserver.c:406) +==3348== by 0x8057F27: main (SICSmain.c:62) +==3348== Address 0x4E89ED9 is 1 bytes inside a block of size 957 free'd +==3348== at 0x4004FDA: free (vg_replace_malloc.c:233) +==3348== by 0x81039B1: readHdbValue (sicshipadaba.c:1797) +==3348== by 0x81010AF: SICSScriptReadCallback (sicshipadaba.c:683) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF222: GetHipadabaPar (hipadaba.c:940) +==3348== by 0x8114091: pollHdb (polldriv.c:37) +==3348== by 0x811459A: PollTask (sicspoll.c:135) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== by 0x8057A25: RunServer (nserver.c:406) +==3348== by 0x8057F27: main (SICSmain.c:62) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27DB2: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) +==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x80F6F79: ContextDo (protocol.c:200) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x805027F: SCInvoke (conman.c:1604) +==3348== by 0x805165F: SCTaskFunction (conman.c:2097) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27CE9: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) +==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x80F6F79: ContextDo (protocol.c:200) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x805027F: SCInvoke (conman.c:1604) +==3348== by 0x805165F: SCTaskFunction (conman.c:2097) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27DB2: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) +==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x80F6F79: ContextDo (protocol.c:200) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x805027F: SCInvoke (conman.c:1604) +==3348== by 0x805165F: SCTaskFunction (conman.c:2097) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27CE9: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100309: sendZippedNodeData (sicshipadaba.c:377) +==3348== by 0x81048DA: ZipGetHdbNode (sicshipadaba.c:2193) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x80F6F79: ContextDo (protocol.c:200) +==3348== by 0x80527B6: InterpExecute (SCinter.c:322) +==3348== by 0x805027F: SCInvoke (conman.c:1604) +==3348== by 0x805165F: SCTaskFunction (conman.c:2097) +==3348== by 0x8059016: TaskSchedule (task.c:211) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D82: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D91: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27DA3: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D3C: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D4F: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D61: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D70: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D82: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D3C: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D4F: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D61: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D70: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27D91: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27DA3: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27CF9: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804F83D: SCWriteZipped (conman.c:1231) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== Conditional jump or move depends on uninitialised value(s) +==3348== at 0xD27CF9: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD28EA0: (within /usr/lib/libz.so.1.2.3) +==3348== by 0xD282D6: deflate (in /usr/lib/libz.so.1.2.3) +==3348== by 0x804FAF2: SCWriteZipped (conman.c:1287) +==3348== by 0x8100226: sendZippedNodeData (sicshipadaba.c:362) +==3348== by 0x81005D9: SICSNotifyCallback (sicshipadaba.c:458) +==3348== by 0x80FDAAF: InvokeCallbackChain (hipadaba.c:154) +==3348== by 0x80FF0CE: SendDataMessage (hipadaba.c:912) +==3348== by 0x80FF158: UpdateHipadabaPar (hipadaba.c:922) +==3348== by 0x81047FE: UpdateHdbNode (sicshipadaba.c:2169) +==3348== by 0x805992C: SicsUnknownProc (macro.c:185) +==3348== by 0x2E059D: TclInvokeStringCommand (in /usr/lib/libtcl8.4.so) +==3348== +==3348== ERROR SUMMARY: 57717 errors from 22 contexts (suppressed: 22 from 1) +==3348== malloc/free: in use at exit: 1,197,084 bytes in 8,439 blocks. +==3348== malloc/free: 595,895 allocs, 587,456 frees, 89,983,020 bytes allocated. +==3348== For counts of detected errors, rerun with: -v +==3348== searching for pointers to 8,439 not-freed blocks. +==3348== checked 708,956 bytes. +==3348== +==3348== LEAK SUMMARY: +==3348== definitely lost: 619,696 bytes in 8,379 blocks. +==3348== possibly lost: 439,796 bytes in 28 blocks. +==3348== still reachable: 137,592 bytes in 32 blocks. +==3348== suppressed: 0 bytes in 0 blocks. +==3348== Use --leak-check=full to see details of leaked memory.