summaryrefslogtreecommitdiffstats
path: root/generic/tclHistory.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-10-18 14:34:41 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-10-18 14:34:41 (GMT)
commitfda1b8f1b395d1d8eb68ca7c5a471ff6501414e2 (patch)
treef2e6aeddc32ca58a03be6b2c0264c5c917956f96 /generic/tclHistory.c
parent30a5873310b4f87f537fe45e45435558044ddce1 (diff)
downloadtcl-fda1b8f1b395d1d8eb68ca7c5a471ff6501414e2.zip
tcl-fda1b8f1b395d1d8eb68ca7c5a471ff6501414e2.tar.gz
tcl-fda1b8f1b395d1d8eb68ca7c5a471ff6501414e2.tar.bz2
Style update and ANSI function definitions.
Diffstat (limited to 'generic/tclHistory.c')
-rw-r--r--generic/tclHistory.c62
1 files changed, 34 insertions, 28 deletions
diff --git a/generic/tclHistory.c b/generic/tclHistory.c
index 784a31d..daef8f3 100644
--- a/generic/tclHistory.c
+++ b/generic/tclHistory.c
@@ -1,4 +1,4 @@
-/*
+/*
* tclHistory.c --
*
* This module and the Tcl library file history.tcl together implement
@@ -9,14 +9,13 @@
* Copyright (c) 1990-1993 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclHistory.c,v 1.7 2004/10/06 14:59:02 dgp Exp $
+ * RCS: @(#) $Id: tclHistory.c,v 1.8 2005/10/18 14:34:41 dkf Exp $
*/
#include "tclInt.h"
-
/*
*----------------------------------------------------------------------
@@ -24,8 +23,7 @@
* Tcl_RecordAndEval --
*
* This procedure adds its command argument to the current list of
- * recorded events and then executes the command by calling
- * Tcl_Eval.
+ * recorded events and then executes the command by calling Tcl_Eval.
*
* Results:
* The return value is a standard Tcl return value, the result of
@@ -38,12 +36,12 @@
*/
int
-Tcl_RecordAndEval(interp, cmd, flags)
- Tcl_Interp *interp; /* Token for interpreter in which command
- * will be executed. */
- CONST char *cmd; /* Command to record. */
- int flags; /* Additional flags. TCL_NO_EVAL means
- * only record: don't execute command.
+Tcl_RecordAndEval(
+ Tcl_Interp *interp, /* Token for interpreter in which command will
+ * be executed. */
+ CONST char *cmd, /* Command to record. */
+ int flags) /* Additional flags. TCL_NO_EVAL means only
+ * record: don't execute command.
* TCL_EVAL_GLOBAL means use Tcl_GlobalEval
* instead of Tcl_Eval. */
{
@@ -61,8 +59,8 @@ Tcl_RecordAndEval(interp, cmd, flags)
result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags);
/*
- * Move the interpreter's object result to the string result,
- * then reset the object result.
+ * Move the interpreter's object result to the string result, then
+ * reset the object result.
*/
(void) Tcl_GetStringResult(interp);
@@ -70,8 +68,8 @@ Tcl_RecordAndEval(interp, cmd, flags)
/*
* Discard the Tcl object created to hold the command.
*/
-
- Tcl_DecrRefCount(cmdPtr);
+
+ Tcl_DecrRefCount(cmdPtr);
} else {
/*
* An empty string. Just reset the interpreter's result.
@@ -103,16 +101,16 @@ Tcl_RecordAndEval(interp, cmd, flags)
*/
int
-Tcl_RecordAndEvalObj(interp, cmdPtr, flags)
- Tcl_Interp *interp; /* Token for interpreter in which command
- * will be executed. */
- Tcl_Obj *cmdPtr; /* Points to object holding the command to
+Tcl_RecordAndEvalObj(
+ Tcl_Interp *interp, /* Token for interpreter in which command will
+ * be executed. */
+ Tcl_Obj *cmdPtr, /* Points to object holding the command to
* record and execute. */
- int flags; /* Additional flags. TCL_NO_EVAL means
- * record only: don't execute the command.
- * TCL_EVAL_GLOBAL means evaluate the
- * script in global variable context instead
- * of the current procedure. */
+ int flags) /* Additional flags. TCL_NO_EVAL means record
+ * only: don't execute the command.
+ * TCL_EVAL_GLOBAL means evaluate the script
+ * in global variable context instead of the
+ * current procedure. */
{
int result;
Tcl_Obj *list[3];
@@ -125,14 +123,14 @@ Tcl_RecordAndEvalObj(interp, cmdPtr, flags)
list[0] = Tcl_NewStringObj("history", -1);
list[1] = Tcl_NewStringObj("add", -1);
list[2] = cmdPtr;
-
+
objPtr = Tcl_NewListObj(3, list);
Tcl_IncrRefCount(objPtr);
(void) Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL);
Tcl_DecrRefCount(objPtr);
/*
- * One possible failure mode above: exceeding a resource limit
+ * One possible failure mode above: exceeding a resource limit.
*/
if (Tcl_LimitExceeded(interp)) {
@@ -149,3 +147,11 @@ Tcl_RecordAndEvalObj(interp, cmdPtr, flags)
}
return result;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */