summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-10-25 01:06:36 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-10-25 01:06:36 (GMT)
commitf030067d93d70355784a6c62c76178ccdc1dfcb7 (patch)
treeaccaa2937bb5fe17800397fc9722c77787d98bae /generic/tclInt.h
parentc004a438e6863bc246919f6b40881f03e239c002 (diff)
downloadtcl-f030067d93d70355784a6c62c76178ccdc1dfcb7.zip
tcl-f030067d93d70355784a6c62c76178ccdc1dfcb7.tar.gz
tcl-f030067d93d70355784a6c62c76178ccdc1dfcb7.tar.bz2
defined new macros to get/set the flags of variables.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 252d06b..6485187 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.186 2004/10/21 17:07:31 dgp Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.187 2004/10/25 01:06:51 msofer Exp $
*/
#ifndef _TCLINT
@@ -530,6 +530,13 @@ typedef struct Var {
#define TclClearVarUndefined(varPtr) \
(varPtr)->flags &= ~VAR_UNDEFINED
+#define TclSetVarTraceActive(varPtr) \
+ (varPtr)->flags |= VAR_TRACE_ACTIVE
+
+#define TclClearVarTraceActive(varPtr) \
+ (varPtr)->flags &= ~VAR_TRACE_ACTIVE
+
+
/*
* Macros to read various flag bits of variables.
* The ANSI C "prototypes" for these macros are:
@@ -559,6 +566,9 @@ typedef struct Var {
#define TclIsVarArrayElement(varPtr) \
((varPtr)->flags & VAR_ARRAY_ELEMENT)
+#define TclIsVarNamespaceVar(varPtr) \
+ ((varPtr)->flags & VAR_NAMESPACE_VAR)
+
#define TclIsVarTemporary(varPtr) \
((varPtr)->flags & VAR_TEMPORARY)
@@ -568,6 +578,28 @@ typedef struct Var {
#define TclIsVarResolved(varPtr) \
((varPtr)->flags & VAR_RESOLVED)
+#define TclIsVarTraceActive(varPtr) \
+ ((varPtr)->flags & VAR_TRACE_ACTIVE)
+
+#define TclIsVarUntraced(varPtr) \
+ ((varPtr)->tracePtr == NULL)
+
+/*
+ * Macros for direct variable access by TEBC
+ */
+
+#define TclIsVarDirectReadable(varPtr) \
+ (TclIsVarScalar(varPtr) \
+ && !TclIsVarUndefined(varPtr) \
+ && TclIsVarUntraced(varPtr))
+
+#define TclIsVarDirectWritable(varPtr) \
+ ( !(((varPtr)->flags & VAR_IN_HASHTABLE) \
+ && ((varPtr)->hPtr == NULL)) \
+ && TclIsVarUntraced(varPtr) \
+ && (TclIsVarScalar(varPtr) \
+ || TclIsVarUndefined(varPtr)))
+
/*
*----------------------------------------------------------------
* Data structures related to procedures. These are used primarily