diff options
author | dkf <dkf@noemail.net> | 2008-12-05 21:38:47 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2008-12-05 21:38:47 (GMT) |
commit | 0345950d4e4882614368ff112870f69fd37117a4 (patch) | |
tree | c207c5d068a3f8ce9acde9a101534b8e67958256 /generic | |
parent | 592453d7b43c20bd11965204ddc7be7e5849a6ad (diff) | |
download | tcl-0345950d4e4882614368ff112870f69fd37117a4.zip tcl-0345950d4e4882614368ff112870f69fd37117a4.tar.gz tcl-0345950d4e4882614368ff112870f69fd37117a4.tar.bz2 |
Implement TIP#335
FossilOrigin-Name: 27a3956c2c6502d23550d0d396219e76124818b4
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 11 | ||||
-rw-r--r-- | generic/tclBasic.c | 26 |
2 files changed, 33 insertions, 4 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index abd9ed7..bdfe02c 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.156 2008/12/05 14:27:36 dkf Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.157 2008/12/05 21:38:47 dkf Exp $ library tcl @@ -2198,7 +2198,7 @@ declare 604 generic { int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv) } -# TIP 335 +# TIP 336 (manipulate the error line) declare 605 generic { int Tcl_GetErrorLine(Tcl_Interp *interp) } @@ -2206,12 +2206,17 @@ declare 606 generic { void Tcl_SetErrorLine(Tcl_Interp *interp, int value) } -# TIP#307 (expose this function!) +# TIP#307 (move results between interpreters) declare 607 generic { void Tcl_TransferResult(Tcl_Interp *sourceInterp, int result, Tcl_Interp *targetInterp) } +# TIP#335 (detect if interpreter in use) +declare 608 generic { + int Tcl_InterpActive(Tcl_Interp *interp) +} + ############################################################################## # Define the platform specific public Tcl interface. These functions are only diff --git a/generic/tclBasic.c b/generic/tclBasic.c index dbcaecd..cf618c7 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.374 2008/10/28 23:29:54 nijtmans Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.375 2008/12/05 21:38:47 dkf Exp $ */ #include "tclInt.h" @@ -3955,6 +3955,30 @@ Tcl_CancelEval( /* *---------------------------------------------------------------------- * + * Tcl_InterpActive -- + * + * Returns non-zero if the specified interpreter is in use, i.e. if there + * is an evaluation currently active in the interpreter. + * + * Results: + * See above. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Tcl_InterpActive( + Tcl_Interp *interp) +{ + return ((Interp *) interp)->numLevels > 0; +} + +/* + *---------------------------------------------------------------------- + * * Tcl_EvalObjv -- * * This function evaluates a Tcl command that has already been parsed |