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:
21
macro.c
21
macro.c
@@ -271,8 +271,7 @@ static void KillExec(ClientData data)
|
||||
/*------------------------------------------------------------------------
|
||||
This is in the Tcl sources
|
||||
*/
|
||||
extern int Tcl_ExecObjCmd(ClientData data, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[]);
|
||||
Tcl_CmdInfo cmd_info;
|
||||
/*-----------------------------------------------------------------------*/
|
||||
static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
@@ -281,7 +280,7 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
|
||||
|
||||
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);
|
||||
@@ -289,7 +288,7 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
|
||||
{
|
||||
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,
|
||||
pUnknown, UnknownKill);
|
||||
|
||||
/* delete dangers */
|
||||
Tcl_DeleteCommand(pInter,"exit");
|
||||
Tcl_DeleteCommand(pInter,"socket");
|
||||
Tcl_DeleteCommand(pInter,"vwait");
|
||||
Tcl_DeleteCommand(pInter,"exec");
|
||||
/* hide dangers */
|
||||
Tcl_HideCommand(pInter,"exit", "hidden_exit");
|
||||
Tcl_HideCommand(pInter,"socket", "hidden_socket");
|
||||
Tcl_HideCommand(pInter,"vwait", "hidden_vwait");
|
||||
{
|
||||
int retval = Tcl_GetCommandInfo(pInter, "exec", &cmd_info);
|
||||
assert (retval != 0);
|
||||
}
|
||||
Tcl_HideCommand(pInter,"exec", "hidden_exec");
|
||||
|
||||
/*
|
||||
install protected exec command
|
||||
|
||||
Reference in New Issue
Block a user