summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-01-15 21:19:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-01-15 21:19:06 (GMT)
commit1f65844631f74a8dfd9e7ed208564f50f401b3c9 (patch)
tree0f1a58bb3c42858070ea1a2eeefac3311847898a
parent568095bebd17af34916de0d4f2d5eb631a98d876 (diff)
downloadtcl-1f65844631f74a8dfd9e7ed208564f50f401b3c9.zip
tcl-1f65844631f74a8dfd9e7ed208564f50f401b3c9.tar.gz
tcl-1f65844631f74a8dfd9e7ed208564f50f401b3c9.tar.bz2
* Updated APIs in generic/tclIOUtil.c and generic/tclPosixStr.c
according to the guidelines of TIP 27. Updated callers. [Patch 499196]
-rw-r--r--ChangeLog31
-rw-r--r--doc/AddErrInfo.34
-rw-r--r--doc/Eval.34
-rw-r--r--doc/FileSystem.36
-rw-r--r--doc/OpenFileChnl.36
-rw-r--r--doc/SetErrno.36
-rw-r--r--doc/Signal.36
-rw-r--r--generic/tcl.decls20
-rw-r--r--generic/tcl.h4
-rw-r--r--generic/tclDecls.h36
-rw-r--r--generic/tclIO.c11
-rw-r--r--generic/tclIOUtil.c16
-rw-r--r--generic/tclInt.decls4
-rw-r--r--generic/tclInt.h8
-rw-r--r--generic/tclIntDecls.h6
-rw-r--r--generic/tclPipe.c8
-rw-r--r--generic/tclPosixStr.c10
-rw-r--r--generic/tclTest.c42
-rw-r--r--mac/tclMacChan.c4
-rw-r--r--unix/tclUnixChan.c4
-rw-r--r--win/tclWinChan.c4
21 files changed, 140 insertions, 100 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a83afe..bb1e525 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,36 @@
2002-01-15 Don Porter <dgp@users.sourceforge.net>
+ * 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 499196]
+
+ * generic/tclDecls.h:
+ * generic/tclIntDecls.h: make genstubs
+
* doc/CrtChannel.3:
* doc/OpenFileChnl.3:
* generic/tcl.decls:
diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3
index e2f1ad1..848c5a3 100644
--- a/doc/AddErrInfo.3
+++ b/doc/AddErrInfo.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: AddErrInfo.3,v 1.5 2000/07/24 00:03:01 jenglish Exp $
+'\" RCS: @(#) $Id: AddErrInfo.3,v 1.6 2002/01/15 21:19:06 dgp Exp $
'\"
.so man.macros
.TH Tcl_AddErrorInfo 3 8.0 Tcl "Tcl Library Procedures"
@@ -26,7 +26,7 @@ Tcl_AddObjErrorInfo, Tcl_AddErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tc
.sp
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
.sp
-char *
+CONST char *
\fBTcl_PosixError\fR(\fIinterp\fR)
.sp
void
diff --git a/doc/Eval.3 b/doc/Eval.3
index a0c8e42..172ba65 100644
--- a/doc/Eval.3
+++ b/doc/Eval.3
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Eval.3,v 1.9 2000/09/19 19:36:55 davidg Exp $
+'\" RCS: @(#) $Id: Eval.3,v 1.10 2002/01/15 21:19:06 dgp Exp $
'\"
.so man.macros
.TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures"
@@ -54,7 +54,7 @@ A Tcl object containing the script to execute.
.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;
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index 3f43a6d..eeee904 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: FileSystem.3,v 1.14 2002/01/03 21:52:15 dgp Exp $
+'\" RCS: @(#) $Id: FileSystem.3,v 1.15 2002/01/15 21:19:06 dgp Exp $
'\"
.so man.macros
.TH Filesystem 3 8.4 Tcl "Tcl Library Procedures"
@@ -196,7 +196,7 @@ Filled with the function to use to unload this piece of code.
.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 @@ which require open or accessing a file's contents will use it
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
diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3
index c694c45..b6f25b9 100644
--- a/doc/OpenFileChnl.3
+++ b/doc/OpenFileChnl.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.16 2002/01/15 17:55:29 dgp Exp $
+'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.17 2002/01/15 21:19:06 dgp Exp $
.so man.macros
.TH Tcl_OpenFileChannel 3 8.3 Tcl "Tcl Library Procedures"
.BS
@@ -117,9 +117,9 @@ int
.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.
.AP int permissions in
diff --git a/doc/SetErrno.3 b/doc/SetErrno.3
index 78adebd..2625c9a 100644
--- a/doc/SetErrno.3
+++ b/doc/SetErrno.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: SetErrno.3,v 1.3 2000/01/26 21:36:35 ericm Exp $
+'\" RCS: @(#) $Id: SetErrno.3,v 1.4 2002/01/15 21:19:06 dgp Exp $
.so man.macros
.TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures"
.BS
@@ -20,10 +20,10 @@ void
int
\fBTcl_GetErrno\fR()
.sp
-char *
+CONST char *
\fBTcl_ErrnoId\fR()
.sp
-char *
+CONST char *
\fBTcl_ErrnoMsg\fR()
.sp
.SH ARGUMENTS
diff --git a/doc/Signal.3 b/doc/Signal.3
index b49dbe7..e11c944 100644
--- a/doc/Signal.3
+++ b/doc/Signal.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Signal.3,v 1.1 2001/04/03 14:53:45 andreas_kupries Exp $
+'\" RCS: @(#) $Id: Signal.3,v 1.2 2002/01/15 21:19:06 dgp Exp $
.so man.macros
.TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures"
.BS
@@ -14,10 +14,10 @@ Tcl_SignalId, Tcl_SignalMsg \- Convert signal codes
.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
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 72d3875..db6a7ed 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.70 2002/01/15 17:55:29 dgp Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.71 2002/01/15 21:19:06 dgp Exp $
library tcl
@@ -462,17 +462,17 @@ declare 126 generic {
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 @@ declare 197 {unix win} {
}
# 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 @@ declare 203 generic {
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 @@ declare 238 generic {
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)
@@ -1609,7 +1609,7 @@ declare 455 generic {
}
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)
diff --git a/generic/tcl.h b/generic/tcl.h
index b4a8d6e..9c8a1ab 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -12,7 +12,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.h,v 1.108 2002/01/15 17:55:29 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.109 2002/01/15 21:19:07 dgp Exp $
*/
#ifndef _TCL
@@ -1501,7 +1501,7 @@ typedef int (Tcl_FSStatProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, struct stat *buf));
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));
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 02a50cb..c65f298 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.70 2002/01/15 17:55:29 dgp Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.71 2002/01/15 21:19:07 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -429,15 +429,15 @@ EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_((
/* 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));
@@ -642,8 +642,8 @@ EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_((
#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,
@@ -661,7 +661,7 @@ EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp * interp,
/* 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));
@@ -769,9 +769,9 @@ EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp * interp,
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 */
@@ -1441,7 +1441,7 @@ EXTERN int Tcl_FSAccess _ANSI_ARGS_((Tcl_Obj * pathPtr,
/* 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 */
@@ -1674,10 +1674,10 @@ typedef struct TclStubs {
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 */
@@ -1761,13 +1761,13 @@ typedef struct TclStubs {
#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 */
@@ -1810,8 +1810,8 @@ typedef struct TclStubs {
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 */
@@ -2027,7 +2027,7 @@ typedef struct TclStubs {
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 */
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 1c12a4b..02d966b 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.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: tclIO.c,v 1.44 2002/01/15 17:55:30 dgp Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.45 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclInt.h"
@@ -2112,8 +2112,15 @@ FlushChannel(interp, chanPtr, calledFromAsyncFlush)
} 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);
}
}
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 7655f2e..7aa8ccf 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.28 2002/01/07 23:09:13 dgp Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.29 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclInt.h"
@@ -111,8 +111,8 @@ Tcl_Channel
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 @@ Tcl_GetCwd(interp, cwdPtr)
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 @@ int
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 @@ Tcl_SetErrno(err)
*----------------------------------------------------------------------
*/
-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_FSOpenFileChannel(interp, pathPtr, modeString, permissions)
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
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 0e448bf..f0e04ef 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -12,7 +12,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.40 2002/01/09 19:09:28 kennykb Exp $
+# RCS: @(#) $Id: tclInt.decls,v 1.41 2002/01/15 21:19:07 dgp Exp $
library tcl
@@ -172,7 +172,7 @@ declare 39 generic {
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)
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 4c85ba6..301632d 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -12,7 +12,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.74 2002/01/15 17:55:30 dgp Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.75 2002/01/15 21:19:07 dgp Exp $
*/
#ifndef _TCLINT
@@ -1541,7 +1541,7 @@ typedef struct TclpTime_t_ *TclpTime_t;
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));
@@ -1703,8 +1703,6 @@ EXTERN int TclGetNamespaceForQualName _ANSI_ARGS_((
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,
@@ -1855,7 +1853,7 @@ EXTERN Tcl_Obj* TclFileDirname _ANSI_ARGS_((Tcl_Interp *interp,
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));
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index f7f0dce..686cdd9 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.33 2002/01/09 19:09:28 kennykb Exp $
+ * RCS: @(#) $Id: tclIntDecls.h,v 1.34 2002/01/15 21:19:07 dgp Exp $
*/
#ifndef _TCLINTDECLS
@@ -156,7 +156,7 @@ EXTERN int TclGetNamespaceForQualName _ANSI_ARGS_((
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));
@@ -563,7 +563,7 @@ typedef struct TclIntStubs {
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 */
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index 4f39c93..931f2a7 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.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: tclPipe.c,v 1.3 1999/04/16 00:46:51 stanton Exp $
+ * RCS: @(#) $Id: tclPipe.c,v 1.4 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclInt.h"
@@ -278,7 +278,7 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
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 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
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 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
}
} 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,
diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c
index 9922ce1..2af10b1 100644
--- a/generic/tclPosixStr.c
+++ b/generic/tclPosixStr.c
@@ -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: tclPosixStr.c,v 1.6 2000/05/11 01:50:59 hobbs Exp $
+ * RCS: @(#) $Id: tclPosixStr.c,v 1.7 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclInt.h"
@@ -35,7 +35,7 @@
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_ErrnoId()
{
switch (errno) {
@@ -480,7 +480,7 @@ Tcl_ErrnoId()
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_ErrnoMsg(err)
int err; /* Error number (such as in errno variable). */
{
@@ -927,7 +927,7 @@ Tcl_ErrnoMsg(err)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_SignalId(sig)
int sig; /* Number of signal. */
{
@@ -1059,7 +1059,7 @@ Tcl_SignalId(sig)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_SignalMsg(sig)
int sig; /* Number of signal. */
{
diff --git a/generic/tclTest.c b/generic/tclTest.c
index b2a1af2..5401352 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.36 2002/01/09 17:50:56 dgp Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.37 2002/01/15 21:19:07 dgp Exp $
*/
#define TCL_TEST
@@ -250,14 +250,18 @@ static int TestsetmainloopCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, char **argv));
static int TestexitmainloopCmd _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,
@@ -4494,8 +4498,8 @@ static Tcl_Channel
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
@@ -4513,8 +4517,8 @@ static Tcl_Channel
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
@@ -4541,8 +4545,8 @@ static Tcl_Channel
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
@@ -4569,8 +4573,8 @@ static Tcl_Channel
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
@@ -5504,8 +5508,8 @@ static Tcl_Channel
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
diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c
index d8bcf6f..0b36485 100644
--- a/mac/tclMacChan.c
+++ b/mac/tclMacChan.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacChan.c,v 1.9 2002/01/15 17:55:30 dgp Exp $
+ * RCS: @(#) $Id: tclMacChan.c,v 1.10 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclInt.h"
@@ -754,7 +754,7 @@ TclpOpenFileChannel(
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
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 27cd5f1..534ae49 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.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: tclUnixChan.c,v 1.24 2002/01/15 17:55:30 dgp Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.25 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -1299,7 +1299,7 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
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
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 8c6dd84..08116ef 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinChan.c,v 1.17 2002/01/15 17:55:30 dgp Exp $
+ * RCS: @(#) $Id: tclWinChan.c,v 1.18 2002/01/15 21:19:07 dgp Exp $
*/
#include "tclWinInt.h"
@@ -659,7 +659,7 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
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