From e57e62df32f40bb243f0e7a00e49d1e2ef41bd77 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Wed, 16 Mar 2005 16:06:31 +0000 Subject: Added interpreter pointer to the command delete proc. --- jim.c | 10 +++++----- jim.h | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/jim.c b/jim.c index 6aad20d..f0f9a96 100644 --- a/jim.c +++ b/jim.c @@ -1,7 +1,7 @@ /* Jim - A small embeddable Tcl interpreter * Copyright 2005 Salvatore Sanfilippo * - * $Id: jim.c,v 1.111 2005/03/16 15:30:40 antirez Exp $ + * $Id: jim.c,v 1.112 2005/03/16 16:06:31 patthoyts Exp $ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2735,7 +2735,7 @@ static void Jim_CommandsHT_ValDestructor(void *interp, void *val) } } else if (cmdPtr->delProc != NULL) { /* If it was a C coded command, call the delProc if any */ - cmdPtr->delProc(cmdPtr->privData); + cmdPtr->delProc(interp, cmdPtr->privData); } Jim_Free(val); } @@ -2778,7 +2778,7 @@ int Jim_CreateCommand(Jim_Interp *interp, const char *cmdName, cmdPtr->staticVars = NULL; } else if (cmdPtr->delProc != NULL) { /* If it was a C coded command, call the delProc if any */ - cmdPtr->delProc(cmdPtr->privData); + cmdPtr->delProc(interp, cmdPtr->privData); } cmdPtr->cmdProc = cmdProc; cmdPtr->privData = privData; @@ -4117,7 +4117,7 @@ static int JimGetCallFrameByInteger(Jim_Interp *interp, Jim_Obj *levelObjPtr, Jim_CallFrame **framePtrPtr) { jim_wide level; - long relLevel; /* level relative to the current one. */ + jim_wide relLevel; /* level relative to the current one. */ Jim_CallFrame *framePtr; if (Jim_GetWide(interp, levelObjPtr, &level) != JIM_OK) @@ -10165,7 +10165,7 @@ int Jim_InteractivePrompt(Jim_Interp *interp) printf("Welcome to Jim version %d.%d, " "Copyright (c) 2005 Salvatore Sanfilippo\n", JIM_VERSION / 100, JIM_VERSION % 100); - printf("CVS ID: $Id: jim.c,v 1.111 2005/03/16 15:30:40 antirez Exp $\n"); + printf("CVS ID: $Id: jim.c,v 1.112 2005/03/16 16:06:31 patthoyts Exp $\n"); while (1) { char prg[1024]; const char *result; diff --git a/jim.h b/jim.h index b4fa48a..c181047 100644 --- a/jim.h +++ b/jim.h @@ -1,7 +1,7 @@ /* Jim - A small embeddable Tcl interpreter * Copyright 2005 Salvatore Sanfilippo * - * $Id: jim.h,v 1.55 2005/03/15 14:42:30 antirez Exp $ + * $Id: jim.h,v 1.56 2005/03/16 16:06:31 patthoyts Exp $ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -383,11 +383,12 @@ typedef struct Jim_Var { Jim_Obj *objPtr; struct Jim_CallFrame *linkFramePtr; } Jim_Var; - + /* The cmd structure. */ typedef int (*Jim_CmdProc)(struct Jim_Interp *interp, int argc, Jim_Obj *const *argv); -typedef void (*Jim_DelCmdProc)(void *privData); +typedef struct Jim_Interp Jim_Interp; +typedef void (*Jim_DelCmdProc)(Jim_Interp *interp, void *privData); /* A command is implemented in C if funcPtr is != NULL, otherwise * it's a Tcl procedure with the arglist and body represented by the -- cgit v1.1