X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/blobdiff_plain/f1d92a2564f181cebcabbd0f8c04fe8966bc17ff..HEAD:/src/tcl/tclhist.c diff --git a/src/tcl/tclhist.c b/src/tcl/tclhist.c index d715564..8a3eb8b 100644 --- a/src/tcl/tclhist.c +++ b/src/tcl/tclhist.c @@ -117,9 +117,10 @@ static int SubsAndEval _ANSI_ARGS_((Interp *iPtr, char *cmd, *---------------------------------------------------------------------- */ -void -Tcl_InitHistory(interp) - Tcl_Interp *interp; /* Interpreter to initialize. */ +void +Tcl_InitHistory ( + Tcl_Interp *interp /* Interpreter to initialize. */ +) { register Interp *iPtr = (Interp *) interp; int i; @@ -138,7 +139,7 @@ Tcl_InitHistory(interp) iPtr->curEvent = 0; iPtr->curEventNum = 0; Tcl_CreateCommand((Tcl_Interp *) iPtr, "history", Tcl_HistoryCmd, - (ClientData) NULL, (void (*)()) NULL); + (ClientData) NULL, (void (*)(int *)) NULL); } /* @@ -163,14 +164,15 @@ Tcl_InitHistory(interp) *---------------------------------------------------------------------- */ -int -Tcl_RecordAndEval(interp, cmd, flags) - Tcl_Interp *interp; /* Token for interpreter in which command +int +Tcl_RecordAndEval ( + Tcl_Interp *interp, /* Token for interpreter in which command * will be executed. */ - char *cmd; /* Command to record. */ - int flags; /* Additional flags to pass to Tcl_Eval. + char *cmd, /* Command to record. */ + int flags /* Additional flags to pass to Tcl_Eval. * TCL_NO_EVAL means only record: don't * execute command. */ +) { register Interp *iPtr = (Interp *) interp; register HistoryEvent *eventPtr; @@ -250,11 +252,12 @@ Tcl_RecordAndEval(interp, cmd, flags) /* ARGSUSED */ int -Tcl_HistoryCmd(dummy, interp, argc, argv) - ClientData dummy; /* Not used. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ +Tcl_HistoryCmd( + ClientData dummy, /* Not used. */ + Tcl_Interp *interp, /* Current interpreter. */ + int argc, /* Number of arguments. */ + char **argv /* Argument strings. */ +) { register Interp *iPtr = (Interp *) interp; register HistoryEvent *eventPtr; @@ -526,10 +529,11 @@ Tcl_HistoryCmd(dummy, interp, argc, argv) *---------------------------------------------------------------------- */ -static void -MakeSpace(hPtr, size) - HistoryEvent *hPtr; - int size; /* # of bytes needed in hPtr. */ +static void +MakeSpace ( + HistoryEvent *hPtr, + int size /* # of bytes needed in hPtr. */ +) { if (hPtr->bytesAvl < size) { ckfree(hPtr->command); @@ -557,10 +561,11 @@ MakeSpace(hPtr, size) *---------------------------------------------------------------------- */ -static void -InsertRev(iPtr, revPtr) - Interp *iPtr; /* Interpreter to use. */ - register HistoryRev *revPtr; /* Revision to add to iPtr's list. */ +static void +InsertRev ( + Interp *iPtr, /* Interpreter to use. */ + register HistoryRev *revPtr /* Revision to add to iPtr's list. */ +) { register HistoryRev *curPtr; register HistoryRev *prevPtr; @@ -625,11 +630,12 @@ InsertRev(iPtr, revPtr) *---------------------------------------------------------------------- */ -static void -RevCommand(iPtr, string) - register Interp *iPtr; /* Interpreter in which to perform the +static void +RevCommand ( + register Interp *iPtr, /* Interpreter in which to perform the * substitution. */ - char *string; /* String to substitute. */ + char *string /* String to substitute. */ +) { register HistoryRev *revPtr; @@ -663,11 +669,12 @@ RevCommand(iPtr, string) *---------------------------------------------------------------------- */ -static void -RevResult(iPtr, string) - register Interp *iPtr; /* Interpreter in which to perform the +static void +RevResult ( + register Interp *iPtr, /* Interpreter in which to perform the * substitution. */ - char *string; /* String to substitute. */ + char *string /* String to substitute. */ +) { register HistoryRev *revPtr; char *evalFirst, *evalLast; @@ -729,10 +736,11 @@ RevResult(iPtr, string) *---------------------------------------------------------------------- */ -static void -DoRevs(iPtr) - register Interp *iPtr; /* Interpreter whose history is to +static void +DoRevs ( + register Interp *iPtr /* Interpreter whose history is to * be modified. */ +) { register HistoryRev *revPtr; register HistoryEvent *eventPtr; @@ -812,9 +820,10 @@ DoRevs(iPtr) */ static HistoryEvent * -GetEvent(iPtr, string) - register Interp *iPtr; /* Interpreter in which to look. */ - char *string; /* Description of event. */ +GetEvent ( + register Interp *iPtr, /* Interpreter in which to look. */ + char *string /* Description of event. */ +) { int eventNum, index; register HistoryEvent *eventPtr; @@ -893,13 +902,14 @@ GetEvent(iPtr, string) *---------------------------------------------------------------------- */ -static int -SubsAndEval(iPtr, cmd, old, new) - register Interp *iPtr; /* Interpreter in which to execute +static int +SubsAndEval ( + register Interp *iPtr, /* Interpreter in which to execute * new command. */ - char *cmd; /* Command in which to substitute. */ - char *old; /* String to search for in command. */ - char *new; /* Replacement string for "old". */ + char *cmd, /* Command in which to substitute. */ + char *old, /* String to search for in command. */ + char *new /* Replacement string for "old". */ +) { char *src, *dst, *newCmd; int count, oldLength, newLength, length, result; @@ -976,13 +986,14 @@ SubsAndEval(iPtr, cmd, old, new) */ static char * -GetWords(iPtr, command, words) - register Interp *iPtr; /* Tcl interpreter in which to place +GetWords ( + register Interp *iPtr, /* Tcl interpreter in which to place * an error message if needed. */ - char *command; /* Command string. */ - char *words; /* Description of which words to extract + char *command, /* Command string. */ + char *words /* Description of which words to extract * from the command. Either num[-num] or * a pattern. */ +) { char *result; char *start, *end, *dst;