summaryrefslogtreecommitdiffstats
path: root/generic/tclTrace.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-04-19 02:45:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-04-19 02:45:38 (GMT)
commit567fb6cc27d5d87678cc7cb02004296436e5fc59 (patch)
tree031a121e00d93b6b2602c248a0d65d12efb7bcba /generic/tclTrace.c
parent31a291920abf3cdcf53dd275bd8712565ba020c8 (diff)
parent75bd116527ce94efc1c14c6dc82c526614ed6c7f (diff)
downloadtcl-567fb6cc27d5d87678cc7cb02004296436e5fc59.zip
tcl-567fb6cc27d5d87678cc7cb02004296436e5fc59.tar.gz
tcl-567fb6cc27d5d87678cc7cb02004296436e5fc59.tar.bz2
merge 8.6
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r--generic/tclTrace.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 872c8ef..8663eae 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -2478,6 +2478,47 @@ TclVarTraceExists(
/*
*----------------------------------------------------------------------
*
+ * TclCheckArrayTraces --
+ *
+ * This function is invoked to when we operate on an array variable,
+ * to allow any array traces to fire.
+ *
+ * Results:
+ * Returns TCL_OK to indicate normal operation. Returns TCL_ERROR if
+ * invocation of a trace function indicated an error. When TCL_ERROR is
+ * returned, then error information is left in interp.
+ *
+ * Side effects:
+ * Almost anything can happen, depending on trace; this function itself
+ * doesn't have any side effects.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclCheckArrayTraces(
+ Tcl_Interp *interp,
+ Var *varPtr,
+ Var *arrayPtr,
+ Tcl_Obj *name,
+ int index)
+{
+ int code = TCL_OK;
+
+ if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY)
+ && (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) {
+ Interp *iPtr = (Interp *)interp;
+
+ code = TclObjCallVarTraces(iPtr, arrayPtr, varPtr, name, NULL,
+ (TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY| TCL_TRACE_ARRAY),
+ /* leaveErrMsg */ 1, index);
+ }
+ return code;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TclCallVarTraces --
*
* This function is invoked to find and invoke relevant trace functions