diff options
author | dgp <dgp@users.sourceforge.net> | 2001-09-24 21:10:32 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2001-09-24 21:10:32 (GMT) |
commit | 85efd4f6340d3db40be6608dc383cf19efb4fecf (patch) | |
tree | 9fe3b099b7850769ca7b1bbf5be9ee6bcc10f7a4 /generic | |
parent | bb93c0bc5c4d8116d1c04051c5f999615b5f06ff (diff) | |
download | tcl-85efd4f6340d3db40be6608dc383cf19efb4fecf.zip tcl-85efd4f6340d3db40be6608dc383cf19efb4fecf.tar.gz tcl-85efd4f6340d3db40be6608dc383cf19efb4fecf.tar.bz2 |
* Updated APIs in
generic/tclUtil.c according to the guidelines of TIP 27.
[Patch 464553]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 12 | ||||
-rw-r--r-- | generic/tclDecls.h | 19 | ||||
-rw-r--r-- | generic/tclEncoding.c | 4 | ||||
-rw-r--r-- | generic/tclInt.decls | 6 | ||||
-rw-r--r-- | generic/tclInt.h | 5 | ||||
-rw-r--r-- | generic/tclIntDecls.h | 11 | ||||
-rw-r--r-- | generic/tclMain.c | 5 | ||||
-rw-r--r-- | generic/tclUtil.c | 34 |
8 files changed, 50 insertions, 46 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index b53bdad..3ea0526 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.58 2001/09/13 11:56:19 msofer Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.59 2001/09/24 21:10:32 dgp Exp $ library tcl @@ -306,7 +306,7 @@ declare 82 generic { int Tcl_CommandComplete(char *cmd) } declare 83 generic { - char * Tcl_Concat(int argc, char **argv) + char * Tcl_Concat(int argc, char * CONST *argv) } declare 84 generic { int Tcl_ConvertElement(CONST char *src, char *dst, int flags) @@ -430,10 +430,12 @@ declare 116 generic { void Tcl_DoWhenIdle(Tcl_IdleProc *proc, ClientData clientData) } declare 117 generic { - char * Tcl_DStringAppend(Tcl_DString *dsPtr, CONST char *str, int length) + CONST char * Tcl_DStringAppend(Tcl_DString *dsPtr, CONST char *str, \ + int length) } declare 118 generic { - char * Tcl_DStringAppendElement(Tcl_DString *dsPtr, CONST char *string) + CONST char * Tcl_DStringAppendElement(Tcl_DString *dsPtr, \ + CONST char *string) } declare 119 generic { void Tcl_DStringEndSublist(Tcl_DString *dsPtr) @@ -680,7 +682,7 @@ declare 191 generic { Tcl_Channel Tcl_MakeTcpClientChannel(ClientData tcpSocket) } declare 192 generic { - char * Tcl_Merge(int argc, char **argv) + char * Tcl_Merge(int argc, char * CONST *argv) } declare 193 generic { Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 9670564..fca0fca 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclDecls.h,v 1.58 2001/09/13 11:56:19 msofer Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.59 2001/09/24 21:10:32 dgp Exp $ */ #ifndef _TCLDECLS @@ -273,7 +273,8 @@ EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp * interp, /* 82 */ EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char * cmd)); /* 83 */ -EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, char ** argv)); +EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, + char * CONST * argv)); /* 84 */ EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char * src, char * dst, int flags)); @@ -400,10 +401,10 @@ EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags)); EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc * proc, ClientData clientData)); /* 117 */ -EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString * dsPtr, +EXTERN CONST char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * str, int length)); /* 118 */ -EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_(( +EXTERN CONST char * Tcl_DStringAppendElement _ANSI_ARGS_(( Tcl_DString * dsPtr, CONST char * string)); /* 119 */ EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_(( @@ -611,7 +612,7 @@ EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp * interp)); EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_(( ClientData tcpSocket)); /* 192 */ -EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char ** argv)); +EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char * CONST * argv)); /* 193 */ EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( Tcl_HashSearch * searchPtr)); @@ -1614,7 +1615,7 @@ typedef struct TclStubs { void (*tcl_CancelIdleCall) _ANSI_ARGS_((Tcl_IdleProc * idleProc, ClientData clientData)); /* 80 */ int (*tcl_Close) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 81 */ int (*tcl_CommandComplete) _ANSI_ARGS_((char * cmd)); /* 82 */ - char * (*tcl_Concat) _ANSI_ARGS_((int argc, char ** argv)); /* 83 */ + char * (*tcl_Concat) _ANSI_ARGS_((int argc, char * CONST * argv)); /* 83 */ int (*tcl_ConvertElement) _ANSI_ARGS_((CONST char * src, char * dst, int flags)); /* 84 */ int (*tcl_ConvertCountedElement) _ANSI_ARGS_((CONST char * src, int length, char * dst, int flags)); /* 85 */ int (*tcl_CreateAlias) _ANSI_ARGS_((Tcl_Interp * slave, char * slaveCmd, Tcl_Interp * target, char * targetCmd, int argc, char ** argv)); /* 86 */ @@ -1656,8 +1657,8 @@ typedef struct TclStubs { void (*tcl_DontCallWhenDeleted) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 114 */ int (*tcl_DoOneEvent) _ANSI_ARGS_((int flags)); /* 115 */ void (*tcl_DoWhenIdle) _ANSI_ARGS_((Tcl_IdleProc * proc, ClientData clientData)); /* 116 */ - char * (*tcl_DStringAppend) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * str, int length)); /* 117 */ - char * (*tcl_DStringAppendElement) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * string)); /* 118 */ + CONST char * (*tcl_DStringAppend) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * str, int length)); /* 117 */ + CONST char * (*tcl_DStringAppendElement) _ANSI_ARGS_((Tcl_DString * dsPtr, CONST char * string)); /* 118 */ void (*tcl_DStringEndSublist) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 119 */ void (*tcl_DStringFree) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 120 */ void (*tcl_DStringGetResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * dsPtr)); /* 121 */ @@ -1739,7 +1740,7 @@ typedef struct TclStubs { Tcl_Channel (*tcl_MakeFileChannel) _ANSI_ARGS_((ClientData handle, int mode)); /* 189 */ int (*tcl_MakeSafe) _ANSI_ARGS_((Tcl_Interp * interp)); /* 190 */ Tcl_Channel (*tcl_MakeTcpClientChannel) _ANSI_ARGS_((ClientData tcpSocket)); /* 191 */ - char * (*tcl_Merge) _ANSI_ARGS_((int argc, char ** argv)); /* 192 */ + char * (*tcl_Merge) _ANSI_ARGS_((int argc, char * CONST * argv)); /* 192 */ Tcl_HashEntry * (*tcl_NextHashEntry) _ANSI_ARGS_((Tcl_HashSearch * searchPtr)); /* 193 */ void (*tcl_NotifyChannel) _ANSI_ARGS_((Tcl_Channel channel, int mask)); /* 194 */ Tcl_Obj * (*tcl_ObjGetVar2) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, int flags)); /* 195 */ diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index f7bc742..b69e2c0 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEncoding.c,v 1.7 2001/07/31 19:12:06 vincentdarley Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.8 2001/09/24 21:10:32 dgp Exp $ */ #include "tclInt.h" @@ -1282,7 +1282,7 @@ OpenEncodingFile(dir, name) { char *argv[3]; Tcl_DString pathString; - char *path; + CONST char *path; Tcl_Channel chan; Tcl_Obj *pathPtr; diff --git a/generic/tclInt.decls b/generic/tclInt.decls index ef88533..575d110 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -10,7 +10,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.decls,v 1.31 2001/09/10 17:17:41 andreas_kupries Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.32 2001/09/24 21:10:32 dgp Exp $ library tcl @@ -243,7 +243,7 @@ declare 58 generic { # Tcl_DString *dirPtr, char *pattern, char *tail) #} declare 60 generic { - int TclNeedSpace(char *start, char *end) + int TclNeedSpace(CONST char *start, CONST char *end) } declare 61 generic { Tcl_Obj * TclNewProcBodyObj(Proc *procPtr) @@ -532,7 +532,7 @@ declare 138 generic { # Tcl_PackageInitProc **proc2Ptr, ClientData *clientDataPtr) #} declare 140 generic { - int TclLooksLikeInt(char *bytes, int length) + int TclLooksLikeInt(CONST char *bytes, int length) } # This is used by TclX, but should otherwise be considered private declare 141 generic { diff --git a/generic/tclInt.h b/generic/tclInt.h index 5565338..eddf120 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -11,7 +11,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.64 2001/09/08 14:05:09 vincentdarley Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.65 2001/09/24 21:10:32 dgp Exp $ */ #ifndef _TCLINT @@ -1617,7 +1617,7 @@ EXTERN void TclAllocateFreeObjects _ANSI_ARGS_((void)); EXTERN int TclArraySet _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *arrayNameObj, Tcl_Obj *arrayElemObj)); EXTERN int TclCheckBadOctal _ANSI_ARGS_((Tcl_Interp *interp, - char *value)); + CONST char *value)); EXTERN int TclCleanupChildren _ANSI_ARGS_((Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan)); @@ -1753,7 +1753,6 @@ EXTERN Var * TclLookupVar _ANSI_ARGS_((Tcl_Interp *interp, int createPart1, int createPart2, Var **arrayPtrPtr)); EXTERN int TclMathInProgress _ANSI_ARGS_((void)); -EXTERN int TclNeedSpace _ANSI_ARGS_((char *start, char *end)); EXTERN Tcl_Obj * TclNewProcBodyObj _ANSI_ARGS_((Proc *procPtr)); EXTERN int TclObjCommandComplete _ANSI_ARGS_((Tcl_Obj *cmdPtr)); EXTERN int TclObjInterpProc _ANSI_ARGS_((ClientData clientData, diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 47e08ad..a89c8bc 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIntDecls.h,v 1.26 2001/08/30 08:53:14 vincentdarley Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.27 2001/09/24 21:10:32 dgp Exp $ */ #ifndef _TCLINTDECLS @@ -214,7 +214,8 @@ EXTERN Var * TclLookupVar _ANSI_ARGS_((Tcl_Interp * interp, Var ** arrayPtrPtr)); /* Slot 59 is reserved */ /* 60 */ -EXTERN int TclNeedSpace _ANSI_ARGS_((char * start, char * end)); +EXTERN int TclNeedSpace _ANSI_ARGS_((CONST char * start, + CONST char * end)); /* 61 */ EXTERN Tcl_Obj * TclNewProcBodyObj _ANSI_ARGS_((Proc * procPtr)); /* 62 */ @@ -429,7 +430,7 @@ EXTERN char * TclGetEnv _ANSI_ARGS_((CONST char * name, Tcl_DString * valuePtr)); /* Slot 139 is reserved */ /* 140 */ -EXTERN int TclLooksLikeInt _ANSI_ARGS_((char * bytes, +EXTERN int TclLooksLikeInt _ANSI_ARGS_((CONST char * bytes, int length)); /* 141 */ EXTERN char * TclpGetCwd _ANSI_ARGS_((Tcl_Interp * interp, @@ -569,7 +570,7 @@ typedef struct TclIntStubs { void *reserved57; Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */ void *reserved59; - int (*tclNeedSpace) _ANSI_ARGS_((char * start, char * end)); /* 60 */ + int (*tclNeedSpace) _ANSI_ARGS_((CONST char * start, CONST char * end)); /* 60 */ Tcl_Obj * (*tclNewProcBodyObj) _ANSI_ARGS_((Proc * procPtr)); /* 61 */ int (*tclObjCommandComplete) _ANSI_ARGS_((Tcl_Obj * cmdPtr)); /* 62 */ int (*tclObjInterpProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 63 */ @@ -665,7 +666,7 @@ typedef struct TclIntStubs { void *reserved137; char * (*tclGetEnv) _ANSI_ARGS_((CONST char * name, Tcl_DString * valuePtr)); /* 138 */ void *reserved139; - int (*tclLooksLikeInt) _ANSI_ARGS_((char * bytes, int length)); /* 140 */ + int (*tclLooksLikeInt) _ANSI_ARGS_((CONST char * bytes, int length)); /* 140 */ char * (*tclpGetCwd) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * cwdPtr)); /* 141 */ int (*tclSetByteCodeFromAny) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, CompileHookProc * hookProc, ClientData clientData)); /* 142 */ int (*tclAddLiteralObj) _ANSI_ARGS_((struct CompileEnv * envPtr, Tcl_Obj * objPtr, LiteralEntry ** litPtrPtr)); /* 143 */ diff --git a/generic/tclMain.c b/generic/tclMain.c index 479ef52..8ad20d5 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMain.c,v 1.12 2001/04/04 23:26:03 dgp Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.13 2001/09/24 21:10:32 dgp Exp $ */ #include "tcl.h" @@ -459,7 +459,8 @@ StdinProc(clientData, mask) (void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue( &tsdPtr->line), -1); - cmd = Tcl_DStringAppend(&tsdPtr->command, "\n", -1); + Tcl_DStringAppend(&tsdPtr->command, "\n", -1); + cmd = Tcl_DStringValue(&tsdPtr->command); Tcl_DStringFree(&tsdPtr->line); if (!Tcl_CommandComplete(cmd)) { gotPartial = 1; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 0afef5c..0eca255 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtil.c,v 1.23 2001/09/19 08:52:46 dkf Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.24 2001/09/24 21:10:32 dgp Exp $ */ #include "tclInt.h" @@ -318,11 +318,11 @@ TclFindElement(interp, list, listLength, elementPtr, nextPtr, sizePtr, * Copy a string and eliminate any backslashes that aren't in braces. * * Results: - * There is no return value. Count characters get copied from src to - * dst. Along the way, if backslash sequences are found outside braces, - * the backslashes are eliminated in the copy. After scanning count - * chars from source, a null character is placed at the end of dst. - * Returns the number of characters that got copied. + * Count characters get copied from src to dst. Along the way, if + * backslash sequences are found outside braces, the backslashes are + * eliminated in the copy. After scanning count chars from source, a + * null character is placed at the end of dst. Returns the number + * of characters that got copied. * * Side effects: * None. @@ -822,7 +822,7 @@ Tcl_ConvertCountedElement(src, length, dst, flags) char * Tcl_Merge(argc, argv) int argc; /* How many strings to merge. */ - char **argv; /* Array of string values. */ + char * CONST *argv; /* Array of string values. */ { # define LOCAL_SIZE 20 int localFlags[LOCAL_SIZE], *flagPtr; @@ -925,7 +925,7 @@ Tcl_Backslash(src, readPtr) char * Tcl_Concat(argc, argv) int argc; /* Number of strings to concatenate. */ - char **argv; /* Array of strings to concatenate. */ + char * CONST *argv; /* Array of strings to concatenate. */ { int totalSize, i; char *p; @@ -940,7 +940,7 @@ Tcl_Concat(argc, argv) return result; } for (p = result, i = 0; i < argc; i++) { - char *element; + CONST char *element; int length; /* @@ -1373,7 +1373,7 @@ Tcl_DStringInit(dsPtr) *---------------------------------------------------------------------- */ -char * +CONST char * Tcl_DStringAppend(dsPtr, string, length) Tcl_DString *dsPtr; /* Structure describing dynamic string. */ CONST char *string; /* String to append. If length is -1 then @@ -1444,7 +1444,7 @@ Tcl_DStringAppend(dsPtr, string, length) *---------------------------------------------------------------------- */ -char * +CONST char * Tcl_DStringAppendElement(dsPtr, string) Tcl_DString *dsPtr; /* Structure describing dynamic string. */ CONST char *string; /* String to append. Must be @@ -1927,8 +1927,8 @@ TclPrecTraceProc(clientData, interp, name1, name2, flags) int TclNeedSpace(start, end) - char *start; /* First character in string. */ - char *end; /* End of string (place where space will + CONST char *start; /* First character in string. */ + CONST char *end; /* End of string (place where space will * be added, if appropriate). */ { Tcl_UniChar ch; @@ -2079,13 +2079,13 @@ TclFormatInt(buffer, n) int TclLooksLikeInt(bytes, length) - register char *bytes; /* Points to first byte of the string. */ + register CONST char *bytes; /* Points to first byte of the string. */ int length; /* Number of bytes in the string. If < 0 * bytes up to the first null byte are * considered (if they may appear in an * integer). */ { - register char *p, *end; + register CONST char *p, *end; if (length < 0) { length = (bytes? strlen(bytes) : 0); @@ -2222,9 +2222,9 @@ TclCheckBadOctal(interp, value) Tcl_Interp *interp; /* Interpreter to use for error reporting. * If NULL, then no error message is left * after errors. */ - char *value; /* String to check. */ + CONST char *value; /* String to check. */ { - register char *p = value; + register CONST char *p = value; /* * A frequent mistake is invalid octal values due to an unwanted |