summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-12-05 21:38:47 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-12-05 21:38:47 (GMT)
commit0ab0d532e146a573c487c7e5e4c66282136b7b57 (patch)
treec207c5d068a3f8ce9acde9a101534b8e67958256 /generic
parent4efb1a0f47c957eb324a55b4e51e7a4207002aa1 (diff)
downloadtcl-0ab0d532e146a573c487c7e5e4c66282136b7b57.zip
tcl-0ab0d532e146a573c487c7e5e4c66282136b7b57.tar.gz
tcl-0ab0d532e146a573c487c7e5e4c66282136b7b57.tar.bz2
Implement TIP#335
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls11
-rw-r--r--generic/tclBasic.c26
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