X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/blobdiff_plain/f1d92a2564f181cebcabbd0f8c04fe8966bc17ff..HEAD:/src/tcl/tclutil.c?ds=inline diff --git a/src/tcl/tclutil.c b/src/tcl/tclutil.c index 13071c2..394b6ff 100644 --- a/src/tcl/tclutil.c +++ b/src/tcl/tclutil.c @@ -92,22 +92,23 @@ static void SetupAppendBuffer _ANSI_ARGS_((Interp *iPtr, *---------------------------------------------------------------------- */ -int -TclFindElement(interp, list, elementPtr, nextPtr, sizePtr, bracePtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. */ - register char *list; /* String containing Tcl list with zero +int +TclFindElement ( + Tcl_Interp *interp, /* Interpreter to use for error reporting. */ + register char *list, /* String containing Tcl list with zero * or more elements (possibly in braces). */ - char **elementPtr; /* Fill in with location of first significant + char **elementPtr, /* Fill in with location of first significant * character in first element of list. */ - char **nextPtr; /* Fill in with location of character just + char **nextPtr, /* Fill in with location of character just * after all white space following end of * argument (i.e. next argument or end of * list). */ - int *sizePtr; /* If non-zero, fill in with size of + int *sizePtr, /* If non-zero, fill in with size of * element. */ - int *bracePtr; /* If non-zero fill in with non-zero/zero + int *bracePtr /* If non-zero fill in with non-zero/zero * to indicate that arg was/wasn't * in braces. */ +) { register char *p; int openBraces = 0; @@ -292,12 +293,13 @@ TclFindElement(interp, list, elementPtr, nextPtr, sizePtr, bracePtr) *---------------------------------------------------------------------- */ -void -TclCopyAndCollapse(count, src, dst) - int count; /* Total number of characters to copy +void +TclCopyAndCollapse ( + int count, /* Total number of characters to copy * from src. */ - register char *src; /* Copy from here... */ - register char *dst; /* ... to here. */ + register char *src, /* Copy from here... */ + register char *dst /* ... to here. */ +) { register char c; int numRead; @@ -348,14 +350,15 @@ TclCopyAndCollapse(count, src, dst) *---------------------------------------------------------------------- */ -int -Tcl_SplitList(interp, list, argcPtr, argvPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting. */ - char *list; /* Pointer to string with list structure. */ - int *argcPtr; /* Pointer to location to fill in with +int +Tcl_SplitList ( + Tcl_Interp *interp, /* Interpreter to use for error reporting. */ + char *list, /* Pointer to string with list structure. */ + int *argcPtr, /* Pointer to location to fill in with * the number of elements in the list. */ - char ***argvPtr; /* Pointer to place to store pointer to array + char ***argvPtr /* Pointer to place to store pointer to array * of pointers to list elements. */ +) { char **argv; register char *p; @@ -434,11 +437,12 @@ Tcl_SplitList(interp, list, argcPtr, argvPtr) *---------------------------------------------------------------------- */ -int -Tcl_ScanElement(string, flagPtr) - char *string; /* String to convert to Tcl list element. */ - int *flagPtr; /* Where to store information to guide +int +Tcl_ScanElement ( + char *string, /* String to convert to Tcl list element. */ + int *flagPtr /* Where to store information to guide * Tcl_ConvertElement. */ +) { int flags, nestingLevel; register char *p; @@ -552,11 +556,12 @@ Tcl_ScanElement(string, flagPtr) *---------------------------------------------------------------------- */ -int -Tcl_ConvertElement(src, dst, flags) - register char *src; /* Source information for list element. */ - char *dst; /* Place to put list-ified element. */ - int flags; /* Flags produced by Tcl_ScanElement. */ +int +Tcl_ConvertElement ( + register char *src, /* Source information for list element. */ + char *dst, /* Place to put list-ified element. */ + int flags /* Flags produced by Tcl_ScanElement. */ +) { register char *p = dst; @@ -663,9 +668,10 @@ Tcl_ConvertElement(src, dst, flags) */ char * -Tcl_Merge(argc, argv) - int argc; /* How many strings to merge. */ - char **argv; /* Array of string values. */ +Tcl_Merge ( + int argc, /* How many strings to merge. */ + char **argv /* Array of string values. */ +) { # define LOCAL_SIZE 20 int localFlags[LOCAL_SIZE], *flagPtr; @@ -732,9 +738,10 @@ Tcl_Merge(argc, argv) */ char * -Tcl_Concat(argc, argv) - int argc; /* Number of strings to concatenate. */ - char **argv; /* Array of strings to concatenate. */ +Tcl_Concat ( + int argc, /* Number of strings to concatenate. */ + char **argv /* Array of strings to concatenate. */ +) { int totalSize, i; register char *p; @@ -802,11 +809,12 @@ Tcl_Concat(argc, argv) *---------------------------------------------------------------------- */ -int -Tcl_StringMatch(string, pattern) - register char *string; /* String. */ - register char *pattern; /* Pattern, which may contain +int +Tcl_StringMatch ( + register char *string, /* String. */ + register char *pattern /* Pattern, which may contain * special characters. */ +) { char c2; @@ -933,15 +941,16 @@ Tcl_StringMatch(string, pattern) *---------------------------------------------------------------------- */ -void -Tcl_SetResult(interp, string, freeProc) - Tcl_Interp *interp; /* Interpreter with which to associate the +void +Tcl_SetResult ( + Tcl_Interp *interp, /* Interpreter with which to associate the * return value. */ - char *string; /* Value to be returned. If NULL, + char *string, /* Value to be returned. If NULL, * the result is set to an empty string. */ - Tcl_FreeProc *freeProc; /* Gives information about the string: + Tcl_FreeProc *freeProc /* Gives information about the string: * TCL_STATIC, TCL_VOLATILE, or the address * of a Tcl_FreeProc such as free. */ +) { register Interp *iPtr = (Interp *) interp; int length; @@ -1069,16 +1078,17 @@ Tcl_AppendResult(Tcl_Interp *interp, ...) *---------------------------------------------------------------------- */ -void -Tcl_AppendElement(interp, string, noSep) - Tcl_Interp *interp; /* Interpreter whose result is to be +void +Tcl_AppendElement ( + Tcl_Interp *interp, /* Interpreter whose result is to be * extended. */ - char *string; /* String to convert to list element and + char *string, /* String to convert to list element and * add to result. */ - int noSep; /* If non-zero, then don't output a + int noSep /* If non-zero, then don't output a * space character before this element, * even if the element isn't the first * thing in the output buffer. */ +) { register Interp *iPtr = (Interp *) interp; int size, flags; @@ -1127,11 +1137,12 @@ Tcl_AppendElement(interp, string, noSep) *---------------------------------------------------------------------- */ -static void -SetupAppendBuffer(iPtr, newSpace) - register Interp *iPtr; /* Interpreter whose result is being set up. */ - int newSpace; /* Make sure that at least this many bytes +static void +SetupAppendBuffer ( + register Interp *iPtr, /* Interpreter whose result is being set up. */ + int newSpace /* Make sure that at least this many bytes * of new information may be added. */ +) { int totalSpace; @@ -1197,9 +1208,10 @@ SetupAppendBuffer(iPtr, newSpace) *---------------------------------------------------------------------- */ -void -Tcl_ResetResult(interp) - Tcl_Interp *interp; /* Interpreter for which to clear result. */ +void +Tcl_ResetResult ( + Tcl_Interp *interp /* Interpreter for which to clear result. */ +) { register Interp *iPtr = (Interp *) interp; @@ -1282,11 +1294,12 @@ Tcl_SetErrorCode(Tcl_Interp *interp, ...) *---------------------------------------------------------------------- */ -int -TclGetListIndex(interp, string, indexPtr) - Tcl_Interp *interp; /* Interpreter for error reporting. */ - char *string; /* String containing list index. */ - int *indexPtr; /* Where to store index. */ +int +TclGetListIndex ( + Tcl_Interp *interp, /* Interpreter for error reporting. */ + char *string, /* String containing list index. */ + int *indexPtr /* Where to store index. */ +) { if (isdigit(*string) || (*string == '-')) { if (Tcl_GetInt(interp, string, indexPtr) != TCL_OK) { @@ -1330,10 +1343,11 @@ TclGetListIndex(interp, string, indexPtr) */ regexp * -TclCompileRegexp(interp, string) - Tcl_Interp *interp; /* For use in error reporting. */ - char *string; /* String for which to produce +TclCompileRegexp ( + Tcl_Interp *interp, /* For use in error reporting. */ + char *string /* String for which to produce * compiled regular expression. */ +) { register Interp *iPtr = (Interp *) interp; int i, length; @@ -1414,9 +1428,10 @@ TclCompileRegexp(interp, string) *---------------------------------------------------------------------- */ -void -regerror(string) - char *string; /* Error message. */ +void +regerror ( + char *string /* Error message. */ +) { tclRegexpError = string; }