- make shutdown more proper (releasing all memory)

- fixed memory leak (releaseing args when error in command)
- introduced startup commands
- modified status file writing (avoid potential corrupted files)
This commit is contained in:
zolliker
2005-09-05 08:14:33 +00:00
parent ba6cf90ab3
commit 476ad8d672
2 changed files with 94 additions and 42 deletions

View File

@ -30,6 +30,7 @@ typedef struct __Clist {
void *pData;
struct __Clist *pNext;
struct __Clist *pPrevious;
int startupOnly;
} CommandList;
typedef struct __SINTER
@ -63,6 +64,12 @@ typedef struct __SINTER
int RemoveCommand(SicsInterp *pInterp, char *pName);
/* kills the command name from the interpreter pInterp
*/
/*-------------------------------------------------------------------------*/
int AddCommandWithFlag(SicsInterp *pInterp, char *pName, ObjectFunc pFunc,
KillFunc pKFunc, void *pData, int startupFlag);
int AddIniCmd(char *pName, ObjectFunc pFunc); /* command will be deleted after startup */
int AddCmd(char *pName, ObjectFunc pFunc); /* syntactic sugar for AddCommand without data */
void RemoveStartupCommands(void); /* called after startup to delete startup commands */
/*-------------------------------------------------------------------------*/
int InterpExecute(SicsInterp *self,pSConnection pCon,char *pCommand);