summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-09-29 21:38:47 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-09-29 21:38:47 (GMT)
commit51d61f0f3368b5b9b14bbbbefb0a2aedb30ed5e3 (patch)
tree493b7c36e3c10db4c4a6edd067cf03ec4aa1a60a /generic/tclInt.h
parentab6eb1243a00175b523c0b8ca52aa43f6edec906 (diff)
downloadtcl-51d61f0f3368b5b9b14bbbbefb0a2aedb30ed5e3.zip
tcl-51d61f0f3368b5b9b14bbbbefb0a2aedb30ed5e3.tar.gz
tcl-51d61f0f3368b5b9b14bbbbefb0a2aedb30ed5e3.tar.bz2
TIP#121 (app exit proc API) implementation from Joe Mistachkin
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h45
1 files changed, 44 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index d60429b..acf4ae5 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -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: tclInt.h,v 1.133 2003/09/29 14:37:14 dkf Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.134 2003/09/29 21:38:49 dkf Exp $
*/
#ifndef _TCLINT
@@ -1094,6 +1094,14 @@ typedef struct Command {
#define CMD_HAS_EXEC_TRACES 0x4
/*
+ * Flag bits for saying what limits are enabled on an interpreter, as
+ * defined in TIP #143.
+ */
+
+#define LIMIT_COMMAND_COUNTS 0x1
+#define LIMIT_WALL_TIME 0x2
+
+/*
*----------------------------------------------------------------
* Data structures related to name resolution procedures.
*----------------------------------------------------------------
@@ -1127,6 +1135,21 @@ typedef struct ResolverScheme {
/*
*----------------------------------------------------------------
+ * This structure defines a list of interpreter/handler script pairs
+ * that will be called when a particular limit is exceeded in some
+ * interpreter.
+ *----------------------------------------------------------------
+ */
+
+typedef struct LimitHandler {
+ Tcl_Interp *interp; /* Which interpreter to execute the handler
+ * in. */
+ Tcl_Obj *handlerObj; /* The handler script itself. */
+ struct LimitHandler *next; /* Pointer to next handler in linked list. */
+} LimitHandler;
+
+/*
+ *----------------------------------------------------------------
* This structure defines an interpreter, which is a collection of
* commands plus other state information related to interpreting
* commands, such as variable storage. Primary responsibility for
@@ -1325,6 +1348,26 @@ typedef struct Interp {
Tcl_Obj *returnOptionsKey; /* holds "-options" */
/*
+ * Resource limit control fields (TIP #143)
+ */
+
+ long limitCheckCounter; /* Counter used to constrain the frequency
+ * of limit checks. */
+ int limits; /* Which limits are to be checked. */
+ long timeGranularity; /* Modulus for the limit check counter to
+ * determine when to apply the time limit
+ * checks. */
+ long timeLimit; /* When the time limit expires. */
+ LimitHandler *timeLimitHandlers;
+ /* Linked list of time limit handlers. */
+ long cmdcountGranularity; /* As with timeLimitGranularity except
+ * for being for command count limits. */
+ int cmdcountLimit; /* The maximum number of commands that this
+ * interpreter may execute. */
+ LimitHandler *cmdcountLimitHandlers;
+ /* Linked list of cmdcount limit handlers. */
+
+ /*
* Statistical information about the bytecode compiler and interpreter's
* operation.
*/