- inserted command statistic

- add runscript parameter to environment object
- added Arg2Tcl0 function
This commit is contained in:
zolliker
2006-06-20 13:28:17 +00:00
parent bd533e6131
commit f88f48fca9
15 changed files with 334 additions and 32 deletions

View File

@ -57,6 +57,7 @@
#include <assert.h>
#include <string.h>
#include <tcl.h>
#include <time.h>
#include "fortify.h"
#include "sics.h"
#include "splitter.h"
@ -151,6 +152,7 @@ static void freeList(int listID);
pNew->pData = pData;
pNew->pNext = NULL;
pNew->startupOnly = startupOnly;
pNew->stat = StatisticsNew(pBueffel);
/* find end of list */
tail = NULL;
@ -232,10 +234,14 @@ static void freeList(int listID);
{
pInterp->pCList = pVictim->pNext;
}
if (pVictim->stat) {
StatisticsKill(pVictim->stat);
}
free(pVictim);
return 1;
}
#define MAXLEN 256
#define MAXCOM 50
extern char *stptok(char *s, char *tok, unsigned int toklen, char *brk);
@ -252,6 +258,7 @@ extern char *SkipSpace(char *pPtr);
char *pPtr;
char **argv = NULL;
commandContext comCon;
Statistics *old;
assert(self);
@ -307,7 +314,9 @@ extern char *SkipSpace(char *pPtr);
Tcl_ResetResult((Tcl_Interp *)self->pTcl);
MacroPush(pCon);
pCon->conStatus = 0;
old = StatisticsBegin(pCommand->stat);
iRet = pCommand->OFunc(pCon, self, pCommand->pData, argc, argv);
StatisticsEnd(old);
/* If a task is registered with the dev exec then conStatus is HWBusy*/
if (pCon->conStatus != HWBusy) {
comCon = SCGetContext(pCon);
@ -444,29 +453,40 @@ extern char *SkipSpace(char *pPtr);
void DeleteInterp(SicsInterp *self)
{
CommandList *pCurrent = NULL;
CommandList *pTemp;
CommandList *pTemp, *tail;
Tcl_Interp *pTcl = NULL;
int i;
assert(self);
self->iDeleting = 1;
/* delete Commandlist */
/* find end of list */
tail = NULL;
pCurrent = self->pCList;
while(pCurrent)
while(pCurrent != NULL)
{
if(pCurrent->KFunc)
tail = pCurrent;
pCurrent = pCurrent->pNext;
}
/* delete Commandlist (reversed order) */
if (tail) {
pCurrent = tail;
while(pCurrent)
{
pCurrent->KFunc(pCurrent->pData);
if(pCurrent->KFunc)
{
pCurrent->KFunc(pCurrent->pData);
}
if(pCurrent->pName)
{
/* printf("Deleting %s\n",pCurrent->pName); */
free(pCurrent->pName);
}
pTemp = pCurrent->pPrevious;
free(pCurrent);
pCurrent = pTemp;
}
if(pCurrent->pName)
{
/* printf("Deleting %s\n",pCurrent->pName); */
free(pCurrent->pName);
}
pTemp = pCurrent->pNext;
free(pCurrent);
pCurrent = pTemp;
}
FreeAliasList(&self->AList); /* M.Z. */