Tcl Source Code

Artifact [ca666608c0]
Login

Artifact ca666608c013f7496563f7ab47d922786af0d092:

Attachment "tip27.patch" to ticket [499196ffff] added by dgp 2002-01-04 08:03:48.
? solaris
? 403531.patch
? tip27.patch
? arrayTrace.patch
? tip22.patch
? getsobj.patch
? crtinterp.patch
? threads.patch
? alloc.patch
? tip-22-33-45.patch3
? patch
? thread.patch
? tip68.patch
? tip-22-33-45.patch4
? global.patch
? tip73.patch
? GetTime.3
? preserve.patch
? vartrace.patch
? ctbug.patch
? stubcrash.patch
? liststring.patch
? source.file
? obj.patch
? pair.c
? pfsi.patch
? main.patch
? strtod.patch
? strtoul-2.patch
? dltest.patch
? build_tclsh.patch
? trace.patch
? tcltest-real.patch
? tcltest.patch
? oldtip27.patch
? final.patch
? compat/strtoul.c.try
? generic/assoc.patch
? generic/tclTest.c.ip
? mac/notes
? tests/main.test
? unix/foo.tcl
? unix/tclMtherr.c.ip
? unix/sdfsdf
? unix/sdfsdfsdf
? unix/but.tcl
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.776
diff -u -u -r1.776 ChangeLog
--- ChangeLog	2002/01/04 00:45:34	1.776
+++ ChangeLog	2002/01/04 00:57:51
@@ -1,5 +1,36 @@
 2002-01-03  Don Porter <[email protected]>
 
+        * doc/AddErrInfo.3 (Tcl_PosixError):
+        * doc/Eval.3 (Tcl_EvalFile):
+        * doc/FileSystem.c (Tcl_FSOpenFileChannel,Tcl_FSOpenFileChannelProc):
+        * doc/OpenFileChnl.3 (Tcl_OpenFileChannel):
+        * doc/SetErrno.3 (Tcl_ErrnoId,Tcl_ErrnoMsg):
+        * doc/Signal.3 (Tcl_SignalId,Tcl_SignalMsg):
+        * generic/tcl.decls (Tcl_ErrnoId,TclErrnoMsg,Tcl_EvalFile,
+	  Tcl_OpenFileChannel,Tcl_PosixError,Tcl_SignalId,Tcl_SignalMsg,
+	  Tcl_FSOpenFileChannel):
+	* generic/tcl.h (Tcl_FSOpenFileChannelProc):
+	* generic/tclIO.c (FlushChannel):
+	* generic/tclIOUtil.c (Tcl_OpenFileChannel,Tcl_EvalFile,TclGetOpenMode,
+	  Tcl_PosixError,Tcl_FSOpenFileChannel):
+	* generic/tclInt.decls (TclGetOpenMode):
+	* generic/tclInt.h (TclOpenFileChannelProc_,TclGetOpenMode,
+	  TclpOpenFileChannel):
+	* generic/tclPipe.c (TclCleanupChildren):
+	* generic/tclPosixStr.c (Tcl_ErrnoId,Tcl_ErrnoMsg,Tcl_SignalId,
+	  Tcl_SignalMsg):
+	* generic.tclTest.c (PretendTclpOpenFileChannel,
+	  TestOpenFileChannelProc1,TestOpenFileChannelProc2,
+	  TestOpenFileChannelProc3,TestReportOpenFileChannel):
+	* mac/tclMacChan.c (TclpOpenFileChannel):
+	* unix/tclUnixChan.c (TclpOpenFileChannel):
+	* win/tclWinChan.c (TclpOpenFileChannel): Updated APIs in
+	  generic/tclIOUtil.c and generic/tclPosixStr.c according to the
+	  guidelines of TIP 27.  Updated callers.  [Patch ]
+
+	* generic/tclDecls.h:
+	* generic/tclIntDecls.h: make genstubs
+
 	* doc/FileSystem.3:
 	* generic/tclIOUtil.c: Updated some old uses of "fileName" to
 	new VFS terminology, "pathPtr".
Index: doc/AddErrInfo.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/AddErrInfo.3,v
retrieving revision 1.5
diff -u -u -r1.5 AddErrInfo.3
--- doc/AddErrInfo.3	2000/07/24 00:03:01	1.5
+++ doc/AddErrInfo.3	2002/01/04 00:57:51
@@ -26,7 +26,7 @@
 .sp
 \fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
 .sp
-char *
+CONST char *
 \fBTcl_PosixError\fR(\fIinterp\fR)
 .sp
 void
Index: doc/Eval.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/Eval.3,v
retrieving revision 1.9
diff -u -u -r1.9 Eval.3
--- doc/Eval.3	2000/09/19 19:36:55	1.9
+++ doc/Eval.3	2002/01/04 00:57:51
@@ -54,7 +54,7 @@
 .AP int flags in
 ORed combination of flag bits that specify additional options.
 \fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported.
-.AP char *fileName in
+.AP "CONST char" *fileName in
 Name of a file containing a Tcl script.
 .AP int objc in
 The number of objects in the array pointed to by \fIobjPtr\fR;
Index: doc/FileSystem.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/FileSystem.3,v
retrieving revision 1.14
diff -u -u -r1.14 FileSystem.3
--- doc/FileSystem.3	2002/01/03 21:52:15	1.14
+++ doc/FileSystem.3	2002/01/04 00:57:51
@@ -196,7 +196,7 @@
 .AP utimbuf *tval in
 The access and modification times in this structure are read and 
 used to set those values for a given file.
-.AP char *modeString in
+.AP "CONST char" *modeString in
 Specifies how the file is to be accessed.  May have any of the values
 allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
 .AP int permissions in
@@ -830,7 +830,7 @@
 typedef Tcl_Channel Tcl_FSOpenFileChannelProc(
 	Tcl_Interp *\fIinterp\fR,
 	Tcl_Obj *\fIpathPtr\fR,
-	char *\fImodeString\fR,
+	CONST char *\fImodeString\fR,
 	int \fIpermissions\fR);
 .CE
 .PP
Index: doc/OpenFileChnl.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/OpenFileChnl.3,v
retrieving revision 1.15
diff -u -u -r1.15 OpenFileChnl.3
--- doc/OpenFileChnl.3	2001/12/10 15:50:46	1.15
+++ doc/OpenFileChnl.3	2002/01/04 00:57:51
@@ -119,9 +119,9 @@
 .AS Tcl_ChannelType newClientProcPtr in
 .AP Tcl_Interp *interp in
 Used for error reporting and to look up a channel registered in it.
-.AP char *fileName in
+.AP "CONST char" *fileName in
 The name of a local or network file.
-.AP char *mode in
+.AP "CONST char" *mode in
 Specifies how the file is to be accessed.  May have any of the values
 allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.  For
 \fBTcl_OpenCommandChannel\fR, may be NULL.
Index: doc/SetErrno.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/SetErrno.3,v
retrieving revision 1.3
diff -u -u -r1.3 SetErrno.3
--- doc/SetErrno.3	2000/01/26 21:36:35	1.3
+++ doc/SetErrno.3	2002/01/04 00:57:51
@@ -20,10 +20,10 @@
 int
 \fBTcl_GetErrno\fR()
 .sp
-char *
+CONST char *
 \fBTcl_ErrnoId\fR()
 .sp
-char *
+CONST char *
 \fBTcl_ErrnoMsg\fR()
 .sp
 .SH ARGUMENTS
Index: doc/Signal.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/Signal.3,v
retrieving revision 1.1
diff -u -u -r1.1 Signal.3
--- doc/Signal.3	2001/04/03 14:53:45	1.1
+++ doc/Signal.3	2002/01/04 00:57:51
@@ -14,10 +14,10 @@
 .nf
 \fB#include <tcl.h>\fR
 .sp
-char *
+CONST char *
 \fBTcl_SignalId\fR(\fIsig\fR)
 .sp
-char *
+CONST char *
 \fBTcl_SignalMsg\fR(\fIsig\fR)
 .sp
 .SH ARGUMENTS
Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.67
diff -u -u -r1.67 tcl.decls
--- generic/tcl.decls	2001/12/18 15:21:20	1.67
+++ generic/tcl.decls	2002/01/04 00:57:51
@@ -462,17 +462,17 @@
     int Tcl_Eof(Tcl_Channel chan)
 }
 declare 127 generic {
-    char * Tcl_ErrnoId(void)
+    CONST char * Tcl_ErrnoId(void)
 }
 declare 128 generic {
-    char * Tcl_ErrnoMsg(int err)
+    CONST char * Tcl_ErrnoMsg(int err)
 }
 declare 129 generic {
     int Tcl_Eval(Tcl_Interp *interp, char *string)
 }
 # This is obsolete, use Tcl_FSEvalFile
 declare 130 generic {
-    int Tcl_EvalFile(Tcl_Interp *interp, char *fileName)
+    int Tcl_EvalFile(Tcl_Interp *interp, CONST char *fileName)
 }
 declare 131 generic {
     int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
@@ -704,8 +704,8 @@
 }
 # This is obsolete, use Tcl_FSOpenFileChannel
 declare 198 generic {
-    Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp, char *fileName, \
-	    char *modeString, int permissions)
+    Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp, CONST char *fileName, \
+	    CONST char *modeString, int permissions)
 }
 declare 199 generic {
     Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port, \
@@ -725,7 +725,7 @@
     int Tcl_PutEnv(CONST char *string)
 }
 declare 204 generic {
-    char * Tcl_PosixError(Tcl_Interp *interp)
+    CONST char * Tcl_PosixError(Tcl_Interp *interp)
 }
 declare 205 generic {
     void Tcl_QueueEvent(Tcl_Event *evPtr, Tcl_QueuePosition position)
@@ -838,10 +838,10 @@
 	    char *newValue, int flags)
 }
 declare 239 generic {
-    char * Tcl_SignalId(int sig)
+    CONST char * Tcl_SignalId(int sig)
 }
 declare 240 generic {
-    char * Tcl_SignalMsg(int sig)
+    CONST char * Tcl_SignalMsg(int sig)
 }
 declare 241 generic {
     void Tcl_SourceRCFile(Tcl_Interp *interp)
@@ -1608,7 +1608,7 @@
 }
 declare 456 generic {
     Tcl_Channel Tcl_FSOpenFileChannel(Tcl_Interp *interp, Tcl_Obj *pathPtr, \
-	    char *modeString, int permissions)
+	    CONST char *modeString, int permissions)
 }
 declare 457 generic {
     Tcl_Obj*  Tcl_FSGetCwd(Tcl_Interp *interp)
Index: generic/tcl.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.h,v
retrieving revision 1.107
diff -u -u -r1.107 tcl.h
--- generic/tcl.h	2001/12/18 15:21:20	1.107
+++ generic/tcl.h	2002/01/04 00:57:52
@@ -1512,7 +1512,7 @@
 typedef int (Tcl_FSAccessProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, int mode));
 typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) 
 	_ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr, 
-	char *modeString, int permissions));
+	CONST char *modeString, int permissions));
 typedef int (Tcl_FSMatchInDirectoryProc) _ANSI_ARGS_((Tcl_Interp* interp, 
 	Tcl_Obj *result, Tcl_Obj *pathPtr, char *pattern, 
 	Tcl_GlobTypeData * types));
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.67
diff -u -u -r1.67 tclDecls.h
--- generic/tclDecls.h	2001/12/18 15:21:20	1.67
+++ generic/tclDecls.h	2002/01/04 00:57:53
@@ -428,15 +428,15 @@
 /* 126 */
 EXTERN int		Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan));
 /* 127 */
-EXTERN char *		Tcl_ErrnoId _ANSI_ARGS_((void));
+EXTERN CONST char *	Tcl_ErrnoId _ANSI_ARGS_((void));
 /* 128 */
-EXTERN char *		Tcl_ErrnoMsg _ANSI_ARGS_((int err));
+EXTERN CONST char *	Tcl_ErrnoMsg _ANSI_ARGS_((int err));
 /* 129 */
 EXTERN int		Tcl_Eval _ANSI_ARGS_((Tcl_Interp * interp, 
 				char * string));
 /* 130 */
 EXTERN int		Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * fileName));
+				CONST char * fileName));
 /* 131 */
 EXTERN int		Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp * interp, 
 				Tcl_Obj * objPtr));
@@ -641,8 +641,8 @@
 #endif /* __WIN32__ */
 /* 198 */
 EXTERN Tcl_Channel	Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * fileName, char * modeString, 
-				int permissions));
+				CONST char * fileName, 
+				CONST char * modeString, int permissions));
 /* 199 */
 EXTERN Tcl_Channel	Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp * interp, 
 				int port, char * address, char * myaddr, 
@@ -660,7 +660,7 @@
 /* 203 */
 EXTERN int		Tcl_PutEnv _ANSI_ARGS_((CONST char * string));
 /* 204 */
-EXTERN char *		Tcl_PosixError _ANSI_ARGS_((Tcl_Interp * interp));
+EXTERN CONST char *	Tcl_PosixError _ANSI_ARGS_((Tcl_Interp * interp));
 /* 205 */
 EXTERN void		Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event * evPtr, 
 				Tcl_QueuePosition position));
@@ -767,9 +767,9 @@
 				char * part1, char * part2, char * newValue, 
 				int flags));
 /* 239 */
-EXTERN char *		Tcl_SignalId _ANSI_ARGS_((int sig));
+EXTERN CONST char *	Tcl_SignalId _ANSI_ARGS_((int sig));
 /* 240 */
-EXTERN char *		Tcl_SignalMsg _ANSI_ARGS_((int sig));
+EXTERN CONST char *	Tcl_SignalMsg _ANSI_ARGS_((int sig));
 /* 241 */
 EXTERN void		Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp * interp));
 /* 242 */
@@ -1439,7 +1439,7 @@
 /* 456 */
 EXTERN Tcl_Channel	Tcl_FSOpenFileChannel _ANSI_ARGS_((
 				Tcl_Interp * interp, Tcl_Obj * pathPtr, 
-				char * modeString, int permissions));
+				CONST char * modeString, int permissions));
 /* 457 */
 EXTERN Tcl_Obj*		Tcl_FSGetCwd _ANSI_ARGS_((Tcl_Interp * interp));
 /* 458 */
@@ -1672,10 +1672,10 @@
     void (*tcl_DStringSetLength) _ANSI_ARGS_((Tcl_DString * dsPtr, int length)); /* 124 */
     void (*tcl_DStringStartSublist) _ANSI_ARGS_((Tcl_DString * dsPtr)); /* 125 */
     int (*tcl_Eof) _ANSI_ARGS_((Tcl_Channel chan)); /* 126 */
-    char * (*tcl_ErrnoId) _ANSI_ARGS_((void)); /* 127 */
-    char * (*tcl_ErrnoMsg) _ANSI_ARGS_((int err)); /* 128 */
+    CONST char * (*tcl_ErrnoId) _ANSI_ARGS_((void)); /* 127 */
+    CONST char * (*tcl_ErrnoMsg) _ANSI_ARGS_((int err)); /* 128 */
     int (*tcl_Eval) _ANSI_ARGS_((Tcl_Interp * interp, char * string)); /* 129 */
-    int (*tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp * interp, char * fileName)); /* 130 */
+    int (*tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * fileName)); /* 130 */
     int (*tcl_EvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 131 */
     void (*tcl_EventuallyFree) _ANSI_ARGS_((ClientData clientData, Tcl_FreeProc * freeProc)); /* 132 */
     void (*tcl_Exit) _ANSI_ARGS_((int status)); /* 133 */
@@ -1759,13 +1759,13 @@
 #ifdef MAC_TCL
     void *reserved197;
 #endif /* MAC_TCL */
-    Tcl_Channel (*tcl_OpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, char * fileName, char * modeString, int permissions)); /* 198 */
+    Tcl_Channel (*tcl_OpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * fileName, CONST char * modeString, int permissions)); /* 198 */
     Tcl_Channel (*tcl_OpenTcpClient) _ANSI_ARGS_((Tcl_Interp * interp, int port, char * address, char * myaddr, int myport, int async)); /* 199 */
     Tcl_Channel (*tcl_OpenTcpServer) _ANSI_ARGS_((Tcl_Interp * interp, int port, char * host, Tcl_TcpAcceptProc * acceptProc, ClientData callbackData)); /* 200 */
     void (*tcl_Preserve) _ANSI_ARGS_((ClientData data)); /* 201 */
     void (*tcl_PrintDouble) _ANSI_ARGS_((Tcl_Interp * interp, double value, char * dst)); /* 202 */
     int (*tcl_PutEnv) _ANSI_ARGS_((CONST char * string)); /* 203 */
-    char * (*tcl_PosixError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 204 */
+    CONST char * (*tcl_PosixError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 204 */
     void (*tcl_QueueEvent) _ANSI_ARGS_((Tcl_Event * evPtr, Tcl_QueuePosition position)); /* 205 */
     int (*tcl_Read) _ANSI_ARGS_((Tcl_Channel chan, char * bufPtr, int toRead)); /* 206 */
 #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
@@ -1808,8 +1808,8 @@
     void (*tcl_SetStdChannel) _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 236 */
     char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, char * newValue, int flags)); /* 237 */
     char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, char * newValue, int flags)); /* 238 */
-    char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */
-    char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */
+    CONST char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */
+    CONST char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */
     void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp)); /* 241 */
     int (*tcl_SplitList) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * listStr, int * argcPtr, char *** argvPtr)); /* 242 */
     void (*tcl_SplitPath) _ANSI_ARGS_((CONST char * path, int * argcPtr, char *** argvPtr)); /* 243 */
@@ -2025,7 +2025,7 @@
     char** (*tcl_FSFileAttrStrings) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_Obj ** objPtrRef)); /* 453 */
     int (*tcl_FSStat) _ANSI_ARGS_((Tcl_Obj * pathPtr, struct stat * buf)); /* 454 */
     int (*tcl_FSAccess) _ANSI_ARGS_((Tcl_Obj * pathPtr, int mode)); /* 455 */
-    Tcl_Channel (*tcl_FSOpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr, char * modeString, int permissions)); /* 456 */
+    Tcl_Channel (*tcl_FSOpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr, CONST char * modeString, int permissions)); /* 456 */
     Tcl_Obj* (*tcl_FSGetCwd) _ANSI_ARGS_((Tcl_Interp * interp)); /* 457 */
     int (*tcl_FSChdir) _ANSI_ARGS_((Tcl_Obj * pathPtr)); /* 458 */
     int (*tcl_FSConvertToPathType) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr)); /* 459 */
Index: generic/tclIO.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIO.c,v
retrieving revision 1.43
diff -u -u -r1.43 tclIO.c
--- generic/tclIO.c	2001/12/17 22:55:50	1.43
+++ generic/tclIO.c	2002/01/04 00:57:54
@@ -2111,8 +2111,15 @@
             } else {
                 Tcl_SetErrno(errorCode);
 		if (interp != NULL) {
+
+		    /*
+		     * Casting away CONST here is safe because the
+		     * TCL_VOLATILE flag guarantees CONST treatment
+		     * of the Posix error string.
+		     */
+
 		    Tcl_SetResult(interp,
-			    Tcl_PosixError(interp), TCL_VOLATILE);
+			    (char *) Tcl_PosixError(interp), TCL_VOLATILE);
 		}
             }
 
Index: generic/tclIOUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOUtil.c,v
retrieving revision 1.27
diff -u -u -r1.27 tclIOUtil.c
--- generic/tclIOUtil.c	2002/01/03 21:52:15	1.27
+++ generic/tclIOUtil.c	2002/01/04 00:57:54
@@ -111,8 +111,8 @@
 Tcl_OpenFileChannel(interp, path, modeString, permissions)
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
 					 * can be NULL. */
-    char *path;                         /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    CONST char *path;                   /* Name of file to open. */
+    CONST char *modeString;             /* A list of POSIX open modes or
 					 * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
 					 * file, with what modes to create
@@ -162,7 +162,7 @@
 int
 Tcl_EvalFile(interp, fileName)
     Tcl_Interp *interp;		/* Interpreter in which to process file. */
-    char *fileName;		/* Name of file to process.  Tilde-substitution
+    CONST char *fileName;	/* Name of file to process.  Tilde-substitution
 				 * will be performed on this name. */
 {
     int ret;
@@ -977,7 +977,7 @@
 TclGetOpenMode(interp, string, seekFlagPtr)
     Tcl_Interp *interp;			/* Interpreter to use for error
 					 * reporting - may be NULL. */
-    char *string;			/* Mode string, e.g. "r+" or
+    CONST char *string;			/* Mode string, e.g. "r+" or
 					 * "RDONLY CREAT". */
     int *seekFlagPtr;			/* Set this to 1 if the caller
                                          * should seek to EOF during the
@@ -1299,12 +1299,12 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tcl_PosixError(interp)
     Tcl_Interp *interp;		/* Interpreter whose $errorCode variable
 				 * is to be changed. */
 {
-    char *id, *msg;
+    CONST char *id, *msg;
 
     msg = Tcl_ErrnoMsg(errno);
     id = Tcl_ErrnoId();
@@ -1502,7 +1502,7 @@
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
                                          * can be NULL. */
     Tcl_Obj *pathPtr;                   /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    CONST char *modeString;             /* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
                                          * file, with what modes to create
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.38
diff -u -u -r1.38 tclInt.decls
--- generic/tclInt.decls	2001/11/23 01:26:47	1.38
+++ generic/tclInt.decls	2002/01/04 00:57:54
@@ -172,7 +172,7 @@
     TclObjCmdProcType TclGetObjInterpProc(void)
 }
 declare 40 generic {
-    int TclGetOpenMode(Tcl_Interp *interp, char *str, int *seekFlagPtr)
+    int TclGetOpenMode(Tcl_Interp *interp, CONST char *str, int *seekFlagPtr)
 }
 declare 41 generic {
     Tcl_Command TclGetOriginalCommand(Tcl_Command command)
Index: generic/tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.71
diff -u -u -r1.71 tclInt.h
--- generic/tclInt.h	2001/11/23 01:26:52	1.71
+++ generic/tclInt.h	2002/01/04 00:57:55
@@ -1528,7 +1528,7 @@
 typedef int (TclStatProc_) _ANSI_ARGS_((CONST char *path, struct stat *buf));
 typedef int (TclAccessProc_) _ANSI_ARGS_((CONST char *path, int mode));
 typedef Tcl_Channel (TclOpenFileChannelProc_) _ANSI_ARGS_((Tcl_Interp *interp,
-	char *fileName, char *modeString,
+	CONST char *fileName, CONST char *modeString,
 	int permissions));
 
 
@@ -1697,8 +1697,6 @@
 			    Namespace **actualCxtPtrPtr,
 			    CONST char **simpleNamePtr));
 EXTERN TclObjCmdProcType TclGetObjInterpProc _ANSI_ARGS_((void));
-EXTERN int		TclGetOpenMode _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *string, int *seekFlagPtr));
 EXTERN Tcl_Command	TclGetOriginalCommand _ANSI_ARGS_((
 			    Tcl_Command command));
 EXTERN int		TclGlob _ANSI_ARGS_((Tcl_Interp *interp,
@@ -1851,7 +1849,7 @@
 						    Tcl_Obj*pathPtr));
 EXTERN int		TclpObjStat _ANSI_ARGS_((Tcl_Obj *pathPtr, struct stat *buf));
 EXTERN Tcl_Channel	TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
-			    Tcl_Obj *pathPtr, char *modeString,
+			    Tcl_Obj *pathPtr, CONST char *modeString,
 			    int permissions));
 EXTERN void		TclpPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,
 			    format));
Index: generic/tclIntDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIntDecls.h,v
retrieving revision 1.31
diff -u -u -r1.31 tclIntDecls.h
--- generic/tclIntDecls.h	2001/11/14 23:17:03	1.31
+++ generic/tclIntDecls.h	2002/01/04 00:57:55
@@ -156,7 +156,7 @@
 EXTERN TclObjCmdProcType TclGetObjInterpProc _ANSI_ARGS_((void));
 /* 40 */
 EXTERN int		TclGetOpenMode _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * str, int * seekFlagPtr));
+				CONST char * str, int * seekFlagPtr));
 /* 41 */
 EXTERN Tcl_Command	TclGetOriginalCommand _ANSI_ARGS_((
 				Tcl_Command command));
@@ -558,7 +558,7 @@
     int (*tclGetLoadedPackages) _ANSI_ARGS_((Tcl_Interp * interp, char * targetName)); /* 37 */
     int (*tclGetNamespaceForQualName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * qualName, Namespace * cxtNsPtr, int flags, Namespace ** nsPtrPtr, Namespace ** altNsPtrPtr, Namespace ** actualCxtPtrPtr, CONST char ** simpleNamePtr)); /* 38 */
     TclObjCmdProcType (*tclGetObjInterpProc) _ANSI_ARGS_((void)); /* 39 */
-    int (*tclGetOpenMode) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * seekFlagPtr)); /* 40 */
+    int (*tclGetOpenMode) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * seekFlagPtr)); /* 40 */
     Tcl_Command (*tclGetOriginalCommand) _ANSI_ARGS_((Tcl_Command command)); /* 41 */
     char * (*tclpGetUserHome) _ANSI_ARGS_((CONST char * name, Tcl_DString * bufferPtr)); /* 42 */
     int (*tclGlobalInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, int flags)); /* 43 */
Index: generic/tclPipe.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclPipe.c,v
retrieving revision 1.3
diff -u -u -r1.3 tclPipe.c
--- generic/tclPipe.c	1999/04/16 00:46:51	1.3
+++ generic/tclPipe.c	2002/01/04 00:57:55
@@ -278,7 +278,7 @@
     int i, abnormalExit, anyErrorInfo;
     Tcl_Pid pid;
     WAIT_STATUS_TYPE waitStatus;
-    char *msg;
+    CONST char *msg;
 
     abnormalExit = 0;
     for (i = 0; i < numPids; i++) {
@@ -324,7 +324,7 @@
 		abnormalExit = 1;
 	    } else if (WIFSIGNALED(waitStatus)) {
                 if (interp != (Tcl_Interp *) NULL) {
-                    char *p;
+                    CONST char *p;
                     
                     p = Tcl_SignalMsg((int) (WTERMSIG(waitStatus)));
                     Tcl_SetErrorCode(interp, "CHILDKILLED", msg1,
@@ -335,7 +335,7 @@
                 }
 	    } else if (WIFSTOPPED(waitStatus)) {
                 if (interp != (Tcl_Interp *) NULL) {
-                    char *p;
+                    CONST char *p;
 
                     p = Tcl_SignalMsg((int) (WSTOPSIG(waitStatus)));
                     Tcl_SetErrorCode(interp, "CHILDSUSP", msg1,
Index: generic/tclPosixStr.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclPosixStr.c,v
retrieving revision 1.6
diff -u -u -r1.6 tclPosixStr.c
--- generic/tclPosixStr.c	2000/05/11 01:50:59	1.6
+++ generic/tclPosixStr.c	2002/01/04 00:57:56
@@ -35,7 +35,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tcl_ErrnoId()
 {
     switch (errno) {
@@ -480,7 +480,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tcl_ErrnoMsg(err)
     int err;			/* Error number (such as in errno variable). */
 {
@@ -927,7 +927,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tcl_SignalId(sig)
     int sig;			/* Number of signal. */
 {
@@ -1059,7 +1059,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+CONST char *
 Tcl_SignalMsg(sig)
     int sig;			/* Number of signal. */
 {
Index: generic/tclTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTest.c,v
retrieving revision 1.34
diff -u -u -r1.34 tclTest.c
--- generic/tclTest.c	2001/11/23 01:29:07	1.34
+++ generic/tclTest.c	2002/01/04 00:57:57
@@ -239,14 +239,18 @@
 			    Tcl_Value *resultPtr));
 static int		TestmainthreadCmd _ANSI_ARGS_((ClientData dummy,
 			    Tcl_Interp *interp, int argc, char **argv));
-static Tcl_Channel	PretendTclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *filename, char *modeString, int permissions));
-static Tcl_Channel	TestOpenFileChannelProc1 _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *filename, char *modeString, int permissions));
-static Tcl_Channel	TestOpenFileChannelProc2 _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *filename, char *modeString, int permissions));
-static Tcl_Channel	TestOpenFileChannelProc3 _ANSI_ARGS_((Tcl_Interp *interp,
-			    char *filename, char *modeString, int permissions));
+static Tcl_Channel	PretendTclpOpenFileChannel _ANSI_ARGS_((
+			    Tcl_Interp *interp, CONST char *fileName,
+			    CONST char *modeString, int permissions));
+static Tcl_Channel	TestOpenFileChannelProc1 _ANSI_ARGS_((
+			    Tcl_Interp *interp, CONST char *fileName,
+			    CONST char *modeString, int permissions));
+static Tcl_Channel	TestOpenFileChannelProc2 _ANSI_ARGS_((
+			    Tcl_Interp *interp, CONST char *fileName,
+			    CONST char *modeString, int permissions));
+static Tcl_Channel	TestOpenFileChannelProc3 _ANSI_ARGS_((
+			    Tcl_Interp *interp, CONST char *fileName,
+			    CONST char *modeString, int permissions));
 static int		TestpanicCmd _ANSI_ARGS_((ClientData dummy,
 			    Tcl_Interp *interp, int argc, char **argv));
 static int		TestparserObjCmd _ANSI_ARGS_((ClientData dummy,
@@ -4357,8 +4361,8 @@
 PretendTclpOpenFileChannel(interp, fileName, modeString, permissions)
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
 					 * can be NULL. */
-    char *fileName;                     /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    CONST char *fileName;               /* Name of file to open. */
+    CONST char *modeString;             /* A list of POSIX open modes or
 					 * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
 					 * file, with what modes to create
@@ -4376,8 +4380,8 @@
 TestOpenFileChannelProc1(interp, fileName, modeString, permissions)
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
                                          * can be NULL. */
-    char *fileName;                     /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    CONST char *fileName;               /* Name of file to open. */
+    CONST char *modeString;             /* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
                                          * file, with what modes to create
@@ -4404,8 +4408,8 @@
 TestOpenFileChannelProc2(interp, fileName, modeString, permissions)
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
                                          * can be NULL. */
-    char *fileName;                     /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    CONST char *fileName;               /* Name of file to open. */
+    CONST char *modeString;             /* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
                                          * file, with what modes to create
@@ -4432,8 +4436,8 @@
 TestOpenFileChannelProc3(interp, fileName, modeString, permissions)
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
                                          * can be NULL. */
-    char *fileName;                     /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    CONST char *fileName;               /* Name of file to open. */
+    CONST char *modeString;             /* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
                                          * file, with what modes to create
@@ -5367,8 +5371,8 @@
 TestReportOpenFileChannel(interp, fileName, modeString, permissions)
     Tcl_Interp *interp;                 /* Interpreter for error reporting;
 					 * can be NULL. */
-    Tcl_Obj *fileName;                     /* Name of file to open. */
-    char *modeString;                   /* A list of POSIX open modes or
+    Tcl_Obj *fileName;                  /* Name of file to open. */
+    CONST char *modeString;             /* A list of POSIX open modes or
 					 * a string such as "rw". */
     int permissions;                    /* If the open involves creating a
 					 * file, with what modes to create
Index: mac/tclMacChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacChan.c,v
retrieving revision 1.8
diff -u -u -r1.8 tclMacChan.c
--- mac/tclMacChan.c	2001/11/23 01:27:21	1.8
+++ mac/tclMacChan.c	2002/01/04 00:57:57
@@ -754,7 +754,7 @@
     Tcl_Interp *interp,			/* Interpreter for error reporting;
                                          * can be NULL. */
     Tcl_Obj *pathPtr,			/* Name of file to open. */
-    char *modeString,			/* A list of POSIX open modes or
+    CONST char *modeString,		/* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions)			/* If the open involves creating a
                                          * file, with what modes to create
Index: unix/tclUnixChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixChan.c,v
retrieving revision 1.23
diff -u -u -r1.23 tclUnixChan.c
--- unix/tclUnixChan.c	2001/11/21 02:36:21	1.23
+++ unix/tclUnixChan.c	2002/01/04 00:57:58
@@ -1299,7 +1299,7 @@
     Tcl_Interp *interp;			/* Interpreter for error reporting;
                                          * can be NULL. */
     Tcl_Obj *pathPtr;			/* Name of file to open. */
-    char *modeString;			/* A list of POSIX open modes or
+    CONST char *modeString;		/* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions;			/* If the open involves creating a
                                          * file, with what modes to create
Index: win/tclWinChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinChan.c,v
retrieving revision 1.16
diff -u -u -r1.16 tclWinChan.c
--- win/tclWinChan.c	2001/10/15 17:34:53	1.16
+++ win/tclWinChan.c	2002/01/04 00:57:58
@@ -659,7 +659,7 @@
     Tcl_Interp *interp;			/* Interpreter for error reporting;
                                          * can be NULL. */
     Tcl_Obj *pathPtr;			/* Name of file to open. */
-    char *modeString;			/* A list of POSIX open modes or
+    CONST char *modeString;		/* A list of POSIX open modes or
                                          * a string such as "rw". */
     int permissions;			/* If the open involves creating a
                                          * file, with what modes to create