- allow scriptcontext objects to be dynamic

- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
zolliker
2009-02-19 13:30:32 +00:00
parent 981534624f
commit 35f2b6b810
33 changed files with 753 additions and 310 deletions

View File

@ -213,7 +213,9 @@ int RemoveCommand(SicsInterp * pInterp, char *pName)
/* found, remove it */
/* kall KillFunction first */
if (pVictim->KFunc) {
pVictim->KFunc(pVictim->pData);
void *data = pVictim->pData;
pVictim->pData = NULL; /* make data unreachable by FindCommandData before killing */
pVictim->KFunc(data);
}
/* delete and unlink data */
@ -237,7 +239,6 @@ int RemoveCommand(SicsInterp * pInterp, char *pName)
return 1;
}
#define MAXLEN 256
#define MAXCOM 50
extern char *stptok(char *s, char *tok, unsigned int toklen, char *brk);
@ -1047,10 +1048,9 @@ char *FindAliases(SicsInterp * pSics, char *name)
}
/*---------------------------------------------------------------------*/
void
ForEachCommand(int (*scanFunction)
(char *name, pDummy object, void *userData)
, void *userData)
void ForEachCommand(int (*scanFunction)
(char *name, pDummy object, void *userData)
, void *userData)
{
CommandList *pCurrent;