Modify macro.c to use TCL public interfaces instead of private ones removed in later versions

r3061 | dcl | 2011-02-18 11:06:51 +1100 (Fri, 18 Feb 2011) | 1 line
This commit is contained in:
Douglas Clowes
2011-02-18 11:06:51 +11:00
parent 7f4b0de463
commit 75048d3763

21
macro.c
View File

@@ -271,8 +271,7 @@ static void KillExec(ClientData data)
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
This is in the Tcl sources This is in the Tcl sources
*/ */
extern int Tcl_ExecObjCmd(ClientData data, Tcl_Interp *interp, Tcl_CmdInfo cmd_info;
int objc, Tcl_Obj *CONST objv[]);
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
static int ProtectedExec(ClientData clientData, Tcl_Interp *interp, static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[]) int objc, Tcl_Obj *CONST objv[])
@@ -281,7 +280,7 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
if(objc < 2) if(objc < 2)
{ {
return Tcl_ExecObjCmd(clientData,interp,objc, objv); return (cmd_info.objProc) (cmd_info.objClientData, interp, objc, objv);
} }
test = Tcl_GetStringFromObj(objv[1],NULL); test = Tcl_GetStringFromObj(objv[1],NULL);
@@ -289,7 +288,7 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
{ {
if(StringDictExists(allowedCommands,test)) if(StringDictExists(allowedCommands,test))
{ {
return Tcl_ExecObjCmd(clientData,interp,objc, objv); return (cmd_info.objProc) (cmd_info.objClientData, interp, objc, objv);
} }
} }
@@ -336,11 +335,15 @@ extern int Nxinter_SafeInit(Tcl_Interp *pTcl); /* from Swig NeXus Tcl interface
Tcl_CreateCommand(pInter,"unknown",(Tcl_CmdProc *)SicsUnknownProc, Tcl_CreateCommand(pInter,"unknown",(Tcl_CmdProc *)SicsUnknownProc,
pUnknown, UnknownKill); pUnknown, UnknownKill);
/* delete dangers */ /* hide dangers */
Tcl_DeleteCommand(pInter,"exit"); Tcl_HideCommand(pInter,"exit", "hidden_exit");
Tcl_DeleteCommand(pInter,"socket"); Tcl_HideCommand(pInter,"socket", "hidden_socket");
Tcl_DeleteCommand(pInter,"vwait"); Tcl_HideCommand(pInter,"vwait", "hidden_vwait");
Tcl_DeleteCommand(pInter,"exec"); {
int retval = Tcl_GetCommandInfo(pInter, "exec", &cmd_info);
assert (retval != 0);
}
Tcl_HideCommand(pInter,"exec", "hidden_exec");
/* /*
install protected exec command install protected exec command