summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-01-23 20:46:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-01-23 20:46:00 (GMT)
commitfe36337ab48292e97cc3cae11a8efe99c1143bde (patch)
tree8b7ee1b7505a49478958828584bb52e02c1a3a8b
parent0575def9cda1df361ad97091ee969acbcc827ce3 (diff)
downloadtcl-fe36337ab48292e97cc3cae11a8efe99c1143bde.zip
tcl-fe36337ab48292e97cc3cae11a8efe99c1143bde.tar.gz
tcl-fe36337ab48292e97cc3cae11a8efe99c1143bde.tar.bz2
* Updated socket interfaces according to TIP 27. Updated callers.
-rw-r--r--ChangeLog18
-rw-r--r--doc/GetHostName.34
-rw-r--r--doc/GetOpnFl.34
-rw-r--r--doc/OpenTcp.36
-rw-r--r--generic/tcl.decls13
-rw-r--r--generic/tclCmdIL.c4
-rw-r--r--generic/tclDecls.h22
-rw-r--r--mac/tclMacSock.c22
-rw-r--r--unix/tclUnixChan.c22
-rw-r--r--unix/tclUnixSock.c4
-rw-r--r--win/tclWinSock.c22
11 files changed, 80 insertions, 61 deletions
diff --git a/ChangeLog b/ChangeLog
index 95aa453..3c9862e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2002-01-23 Don Porter <dgp@users.sourceforge.net>
+
+ * doc/GetHostName.3:
+ * doc/GetOpnFl.3:
+ * doc/OpenTcp.3:
+ * tcl.decls (Tcl_GetHostName,Tcl_GetOpenFile,Tcl_OpenTcpClient,
+ Tcl_OpenTclServer):
+ * mac/tclMacSock.c (CreateSocket,Tcl_OpenTcpClient,Tcl_OpenTcpServer,
+ Tcl_GetHostName,GetHostFromString):
+ * unix/tclUnixChan.c (CreateSocket,CreateSocketAddress,
+ Tcl_OpenTcpClient,Tcl_OpenTcpServer,Tcl_GetOpenFile):
+ * unix/tclUnixSock.c (Tcl_GetHostName):
+ * win/tclWinSock.c (CreateSocket,CreateSocketAddress,
+ Tcl_OpenTcpClient,Tcl_OpenTcpServer,Tcl_GetHostName):
+ Updated socket interfaces according to TIP 27.
+ * generic/tclCmdIL.c (InfoHostnameCmd): Updated callers.
+ * generic/tclDecls.h: make genstubs
+
2002-01-21 David Gravereaux <davygrvy@pobox.com>
* generic/tclLoadNone.c: TclpLoadFile() didn't match proto of
diff --git a/doc/GetHostName.3 b/doc/GetHostName.3
index 6cb786f..e67349d 100644
--- a/doc/GetHostName.3
+++ b/doc/GetHostName.3
@@ -2,7 +2,7 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
-'\" RCS: @(#) $Id: GetHostName.3,v 1.1 2000/01/21 18:52:07 ericm Exp $
+'\" RCS: @(#) $Id: GetHostName.3,v 1.2 2002/01/23 20:46:01 dgp Exp $
'\"
.so man.macros
.TH Tcl_GetHostName 3 8.3 Tcl "Tcl Library Procedures"
@@ -13,7 +13,7 @@ Tcl_GetHostName \- get the name of the local host
.nf
\fB#include <tcl.h>\fR
.sp
-char *
+CONST char *
\fBTcl_GetHostName\fR()
.SH DESCRIPTION
diff --git a/doc/GetOpnFl.3 b/doc/GetOpnFl.3
index be13875..e4cbf67 100644
--- a/doc/GetOpnFl.3
+++ b/doc/GetOpnFl.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: GetOpnFl.3,v 1.3 2000/04/14 23:01:51 hobbs Exp $
+'\" RCS: @(#) $Id: GetOpnFl.3,v 1.4 2002/01/23 20:46:01 dgp Exp $
.so man.macros
.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
.BS
@@ -21,7 +21,7 @@ int
.AS Tcl_Interp checkUsage
.AP Tcl_Interp *interp in
Tcl interpreter from which file handle is to be obtained.
-.AP char *string in
+.AP "CONST char" *string in
String identifying channel, such as \fBstdin\fR or \fBfile4\fR.
.AP int write in
Non-zero means the file will be used for writing, zero means it will
diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3
index 9b2b8d9..c2ca531 100644
--- a/doc/OpenTcp.3
+++ b/doc/OpenTcp.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: OpenTcp.3,v 1.3 2000/04/14 23:01:52 hobbs Exp $
+'\" RCS: @(#) $Id: OpenTcp.3,v 1.4 2002/01/23 20:46:01 dgp Exp $
.so man.macros
.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures"
.BS
@@ -31,12 +31,12 @@ Tcl interpreter to use for error reporting. If non-NULL and an
error occurs, an error message is left in the interpreter's result.
.AP int port in
A port number to connect to as a client or to listen on as a server.
-.AP char *host in
+.AP "CONST char" *host in
A string specifying a host name or address for the remote end of the connection.
.AP int myport in
A port number for the client's end of the socket. If 0, a port number
is allocated at random.
-.AP char *myaddr in
+.AP "CONST char" *myaddr in
A string specifying the host name or address for network interface to use
for the local end of the connection. If NULL, a default interface is
chosen.
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 878fa5d..fb2bd6d 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.76 2002/01/21 16:15:03 dgp Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.77 2002/01/23 20:46:01 dgp Exp $
library tcl
@@ -581,7 +581,7 @@ declare 161 generic {
int Tcl_GetErrno(void)
}
declare 162 generic {
- char * Tcl_GetHostName(void)
+ CONST char * Tcl_GetHostName(void)
}
declare 163 generic {
int Tcl_GetInterpPath(Tcl_Interp *askInterp, Tcl_Interp *slaveInterp)
@@ -600,7 +600,7 @@ declare 166 generic {
# generic interface, so we inlcude it here for compatibility reasons.
declare 167 unix {
- int Tcl_GetOpenFile(Tcl_Interp *interp, char *str, int forWriting, \
+ int Tcl_GetOpenFile(Tcl_Interp *interp, CONST char *str, int forWriting, \
int checkUsage, ClientData *filePtr)
}
# Obsolete. Should now use Tcl_FSGetPathType which is objectified
@@ -710,11 +710,12 @@ declare 198 generic {
}
declare 199 generic {
Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port, \
- char *address, char *myaddr, int myport, int async)
+ CONST char *address, CONST char *myaddr, int myport, int async)
}
declare 200 generic {
- Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port, char *host, \
- Tcl_TcpAcceptProc *acceptProc, ClientData callbackData)
+ Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port, \
+ CONST char *host, Tcl_TcpAcceptProc *acceptProc, \
+ ClientData callbackData)
}
declare 201 generic {
void Tcl_Preserve(ClientData data)
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 1602ab5..d0274a0 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.37 2002/01/17 04:37:33 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.38 2002/01/23 20:46:01 dgp Exp $
*/
#include "tclInt.h"
@@ -1074,7 +1074,7 @@ InfoHostnameCmd(dummy, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- char *name;
+ CONST char *name;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index f87b47e..967636e 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.76 2002/01/21 16:15:03 dgp Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.77 2002/01/23 20:46:01 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -535,7 +535,7 @@ EXTERN CONST char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp * interp,
/* 161 */
EXTERN int Tcl_GetErrno _ANSI_ARGS_((void));
/* 162 */
-EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void));
+EXTERN CONST char * Tcl_GetHostName _ANSI_ARGS_((void));
/* 163 */
EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((
Tcl_Interp * askInterp,
@@ -549,8 +549,8 @@ EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp * interp));
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 167 */
EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, int forWriting, int checkUsage,
- ClientData * filePtr));
+ CONST char * str, int forWriting,
+ int checkUsage, ClientData * filePtr));
#endif /* UNIX */
/* 168 */
EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((CONST char * path));
@@ -647,11 +647,11 @@ EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp * interp,
CONST char * modeString, int permissions));
/* 199 */
EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp * interp,
- int port, char * address, char * myaddr,
- int myport, int async));
+ int port, CONST char * address,
+ CONST char * myaddr, int myport, int async));
/* 200 */
EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp * interp,
- int port, char * host,
+ int port, CONST char * host,
Tcl_TcpAcceptProc * acceptProc,
ClientData callbackData));
/* 201 */
@@ -1711,13 +1711,13 @@ typedef struct TclStubs {
int (*tcl_GetCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, Tcl_CmdInfo * infoPtr)); /* 159 */
CONST char * (*tcl_GetCommandName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Command command)); /* 160 */
int (*tcl_GetErrno) _ANSI_ARGS_((void)); /* 161 */
- char * (*tcl_GetHostName) _ANSI_ARGS_((void)); /* 162 */
+ CONST char * (*tcl_GetHostName) _ANSI_ARGS_((void)); /* 162 */
int (*tcl_GetInterpPath) _ANSI_ARGS_((Tcl_Interp * askInterp, Tcl_Interp * slaveInterp)); /* 163 */
Tcl_Interp * (*tcl_GetMaster) _ANSI_ARGS_((Tcl_Interp * interp)); /* 164 */
CONST char * (*tcl_GetNameOfExecutable) _ANSI_ARGS_((void)); /* 165 */
Tcl_Obj * (*tcl_GetObjResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 166 */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- int (*tcl_GetOpenFile) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int forWriting, int checkUsage, ClientData * filePtr)); /* 167 */
+ int (*tcl_GetOpenFile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int forWriting, int checkUsage, ClientData * filePtr)); /* 167 */
#endif /* UNIX */
#ifdef __WIN32__
void *reserved167;
@@ -1764,8 +1764,8 @@ typedef struct TclStubs {
void *reserved197;
#endif /* MAC_TCL */
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 */
+ Tcl_Channel (*tcl_OpenTcpClient) _ANSI_ARGS_((Tcl_Interp * interp, int port, CONST char * address, CONST char * myaddr, int myport, int async)); /* 199 */
+ Tcl_Channel (*tcl_OpenTcpServer) _ANSI_ARGS_((Tcl_Interp * interp, int port, CONST 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 */
diff --git a/mac/tclMacSock.c b/mac/tclMacSock.c
index 5239cfc..7112ee3 100644
--- a/mac/tclMacSock.c
+++ b/mac/tclMacSock.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: tclMacSock.c,v 1.10 2002/01/15 17:55:30 dgp Exp $
+ * RCS: @(#) $Id: tclMacSock.c,v 1.11 2002/01/23 20:46:01 dgp Exp $
*/
#include "tclInt.h"
@@ -138,14 +138,14 @@ static pascal void CleanUpExitProc _ANSI_ARGS_((void));
static void ClearZombieSockets _ANSI_ARGS_((void));
static void CloseCompletionRoutine _ANSI_ARGS_((TCPiopb *pb));
static TcpState * CreateSocket _ANSI_ARGS_((Tcl_Interp *interp,
- int port, char *host, char *myAddr, int myPort,
- int server, int async));
+ int port, CONST char *host, CONST char *myAddr,
+ int myPort, int server, int async));
static pascal void DNRCompletionRoutine _ANSI_ARGS_((
struct hostInfo *hostinfoPtr,
DNRState *dnrStatePtr));
static void FreeSocketInfo _ANSI_ARGS_((TcpState *statePtr));
static long GetBufferSize _ANSI_ARGS_((void));
-static OSErr GetHostFromString _ANSI_ARGS_((char *name,
+static OSErr GetHostFromString _ANSI_ARGS_((CONST char *name,
ip_addr *address));
static OSErr GetLocalAddress _ANSI_ARGS_((unsigned long *addr));
static void IOCompletionRoutine _ANSI_ARGS_((TCPiopb *pb));
@@ -1654,8 +1654,8 @@ static TcpState *
CreateSocket(
Tcl_Interp *interp, /* For error reporting; can be NULL. */
int port, /* Port number to open. */
- char *host, /* Name of host on which to open port. */
- char *myaddr, /* Optional client-side address */
+ CONST char *host, /* Name of host on which to open port. */
+ CONST char *myaddr, /* Optional client-side address */
int myport, /* Optional client-side port */
int server, /* 1 if socket should be a server socket,
* else 0 for a client socket. */
@@ -1844,8 +1844,8 @@ Tcl_Channel
Tcl_OpenTcpClient(
Tcl_Interp *interp, /* For error reporting; can be NULL. */
int port, /* Port number to open. */
- char *host, /* Host on which to open port. */
- char *myaddr, /* Client-side address */
+ CONST char *host, /* Host on which to open port. */
+ CONST char *myaddr, /* Client-side address */
int myport, /* Client-side port */
int async) /* If nonzero, attempt to do an
* asynchronous connect. Otherwise
@@ -1898,7 +1898,7 @@ Tcl_OpenTcpServer(
Tcl_Interp *interp, /* For error reporting - may be
* NULL. */
int port, /* Port number to open. */
- char *host, /* Name of local host. */
+ CONST char *host, /* Name of local host. */
Tcl_TcpAcceptProc *acceptProc, /* Callback for accepting connections
* from new clients. */
ClientData acceptProcData) /* Data for the callback. */
@@ -2225,7 +2225,7 @@ TcpAccept(
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_GetHostName()
{
static int hostnameInited = 0;
@@ -2426,7 +2426,7 @@ CleanUpExitProc()
static OSErr
GetHostFromString(
- char *name, /* Host in string form. */
+ CONST char *name, /* Host in string form. */
ip_addr *address) /* Returned IP address. */
{
OSErr err;
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 6c7e2ee..6386bd5 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.26 2002/01/17 04:37:33 dgp Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.27 2002/01/23 20:46:01 dgp Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -175,11 +175,11 @@ typedef struct TcpState {
*/
static TcpState * CreateSocket _ANSI_ARGS_((Tcl_Interp *interp,
- int port, char *host, int server,
- char *myaddr, int myport, int async));
+ int port, CONST char *host, int server,
+ CONST char *myaddr, int myport, int async));
static int CreateSocketAddress _ANSI_ARGS_(
(struct sockaddr_in *sockaddrPtr,
- char *host, int port));
+ CONST char *host, int port));
static int FileBlockModeProc _ANSI_ARGS_((
ClientData instanceData, int mode));
static int FileCloseProc _ANSI_ARGS_((ClientData instanceData,
@@ -2024,11 +2024,11 @@ static TcpState *
CreateSocket(interp, port, host, server, myaddr, myport, async)
Tcl_Interp *interp; /* For error reporting; can be NULL. */
int port; /* Port number to open. */
- char *host; /* Name of host on which to open port.
+ CONST char *host; /* Name of host on which to open port.
* NULL implies INADDR_ANY */
int server; /* 1 if socket should be a server socket,
* else 0 for a client socket. */
- char *myaddr; /* Optional client-side address */
+ CONST char *myaddr; /* Optional client-side address */
int myport; /* Optional client-side port */
int async; /* If nonzero and creating a client socket,
* attempt to do an async connect. Otherwise
@@ -2205,7 +2205,7 @@ addressError:
static int
CreateSocketAddress(sockaddrPtr, host, port)
struct sockaddr_in *sockaddrPtr; /* Socket address */
- char *host; /* Host. NULL implies INADDR_ANY */
+ CONST char *host; /* Host. NULL implies INADDR_ANY */
int port; /* Port number */
{
struct hostent *hostent; /* Host database entry */
@@ -2287,8 +2287,8 @@ Tcl_Channel
Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async)
Tcl_Interp *interp; /* For error reporting; can be NULL. */
int port; /* Port number to open. */
- char *host; /* Host on which to open port. */
- char *myaddr; /* Client-side address */
+ CONST char *host; /* Host on which to open port. */
+ CONST char *myaddr; /* Client-side address */
int myport; /* Client-side port */
int async; /* If nonzero, attempt to do an
* asynchronous connect. Otherwise
@@ -2384,7 +2384,7 @@ Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData)
Tcl_Interp *interp; /* For error reporting - may be
* NULL. */
int port; /* Port number to open. */
- char *myHost; /* Name of local host. */
+ CONST char *myHost; /* Name of local host. */
Tcl_TcpAcceptProc *acceptProc; /* Callback for accepting connections
* from new clients. */
ClientData acceptProcData; /* Data for the callback. */
@@ -2585,7 +2585,7 @@ TclpGetDefaultStdChannel(type)
int
Tcl_GetOpenFile(interp, string, forWriting, checkUsage, filePtr)
Tcl_Interp *interp; /* Interpreter in which to find file. */
- char *string; /* String that identifies file. */
+ CONST char *string; /* String that identifies file. */
int forWriting; /* 1 means the file is going to be used
* for writing, 0 means for reading. */
int checkUsage; /* 1 means verify that the file was opened
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 37d430e..d971aec 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.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: tclUnixSock.c,v 1.4 1999/04/16 00:48:05 stanton Exp $
+ * RCS: @(#) $Id: tclUnixSock.c,v 1.5 2002/01/23 20:46:01 dgp Exp $
*/
#include "tcl.h"
@@ -62,7 +62,7 @@ TCL_DECLARE_MUTEX(hostMutex)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_GetHostName()
{
#ifndef NO_UNAME
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 5864343..6b67271 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.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: tclWinSock.c,v 1.23 2002/01/15 17:55:31 dgp Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.24 2002/01/23 20:46:01 dgp Exp $
*/
#include "tclWinInt.h"
@@ -171,11 +171,11 @@ static WNDCLASSA windowClass;
*/
static SocketInfo * CreateSocket _ANSI_ARGS_((Tcl_Interp *interp,
- int port, char *host, int server, char *myaddr,
- int myport, int async));
+ int port, CONST char *host, int server,
+ CONST char *myaddr, int myport, int async));
static int CreateSocketAddress _ANSI_ARGS_(
(struct sockaddr_in *sockaddrPtr,
- char *host, int port));
+ CONST char *host, int port));
static void InitSockets _ANSI_ARGS_((void));
static SocketInfo * NewSocketInfo _ANSI_ARGS_((SOCKET socket));
static void SocketCheckProc _ANSI_ARGS_((ClientData clientData,
@@ -1014,10 +1014,10 @@ static SocketInfo *
CreateSocket(interp, port, host, server, myaddr, myport, async)
Tcl_Interp *interp; /* For error reporting; can be NULL. */
int port; /* Port number to open. */
- char *host; /* Name of host on which to open port. */
+ CONST char *host; /* Name of host on which to open port. */
int server; /* 1 if socket should be a server socket,
* else 0 for a client socket. */
- char *myaddr; /* Optional client-side address */
+ CONST char *myaddr; /* Optional client-side address */
int myport; /* Optional client-side port */
int async; /* If nonzero, connect client socket
* asynchronously. */
@@ -1211,7 +1211,7 @@ error:
static int
CreateSocketAddress(sockaddrPtr, host, port)
struct sockaddr_in *sockaddrPtr; /* Socket address */
- char *host; /* Host. NULL implies INADDR_ANY */
+ CONST char *host; /* Host. NULL implies INADDR_ANY */
int port; /* Port number */
{
struct hostent *hostent; /* Host database entry */
@@ -1355,8 +1355,8 @@ Tcl_Channel
Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async)
Tcl_Interp *interp; /* For error reporting; can be NULL. */
int port; /* Port number to open. */
- char *host; /* Host on which to open port. */
- char *myaddr; /* Client-side address */
+ CONST char *host; /* Host on which to open port. */
+ CONST char *myaddr; /* Client-side address */
int myport; /* Client-side port */
int async; /* If nonzero, should connect
* client socket asynchronously. */
@@ -1471,7 +1471,7 @@ Tcl_OpenTcpServer(interp, port, host, acceptProc, acceptProcData)
Tcl_Interp *interp; /* For error reporting - may be
* NULL. */
int port; /* Port number to open. */
- char *host; /* Name of local host. */
+ COSNT char *host; /* Name of local host. */
Tcl_TcpAcceptProc *acceptProc; /* Callback for accepting connections
* from new clients. */
ClientData acceptProcData; /* Data for the callback. */
@@ -2327,7 +2327,7 @@ SocketProc(hwnd, message, wParam, lParam)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_GetHostName()
{
DWORD length;