aboutsummaryrefslogtreecommitdiff
path: root/X11
diff options
context:
space:
mode:
Diffstat (limited to 'X11')
-rw-r--r--X11/xtrans/Xtrans.c34
-rw-r--r--X11/xtrans/Xtrans.h20
-rw-r--r--X11/xtrans/Xtransint.h34
-rw-r--r--X11/xtrans/Xtranslcl.c74
-rw-r--r--X11/xtrans/Xtranssock.c35
-rw-r--r--X11/xtrans/doc/xtrans.xml88
6 files changed, 148 insertions, 137 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c
index ae8ffad8e..28808030c 100644
--- a/X11/xtrans/Xtrans.c
+++ b/X11/xtrans/Xtrans.c
@@ -185,7 +185,8 @@ TRANS(SelectTransport) (const char *protocol)
static
#endif /* TEST_t */
int
-TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
+TRANS(ParseAddress) (const char *address,
+ char **protocol, char **host, char **port)
{
/*
@@ -391,7 +392,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
*/
static XtransConnInfo
-TRANS(Open) (int type, char *address)
+TRANS(Open) (int type, const char *address)
{
char *protocol = NULL, *host = NULL, *port = NULL;
@@ -489,7 +490,7 @@ TRANS(Open) (int type, char *address)
*/
static XtransConnInfo
-TRANS(Reopen) (int type, int trans_id, int fd, char *port)
+TRANS(Reopen) (int type, int trans_id, int fd, const char *port)
{
XtransConnInfo ciptr = NULL;
@@ -563,7 +564,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
#ifdef TRANS_CLIENT
XtransConnInfo
-TRANS(OpenCOTSClient) (char *address)
+TRANS(OpenCOTSClient) (const char *address)
{
prmsg (2,"OpenCOTSClient(%s)\n", address);
@@ -576,7 +577,7 @@ TRANS(OpenCOTSClient) (char *address)
#ifdef TRANS_SERVER
XtransConnInfo
-TRANS(OpenCOTSServer) (char *address)
+TRANS(OpenCOTSServer) (const char *address)
{
prmsg (2,"OpenCOTSServer(%s)\n", address);
@@ -589,7 +590,7 @@ TRANS(OpenCOTSServer) (char *address)
#ifdef TRANS_CLIENT
XtransConnInfo
-TRANS(OpenCLTSClient) (char *address)
+TRANS(OpenCLTSClient) (const char *address)
{
prmsg (2,"OpenCLTSClient(%s)\n", address);
@@ -602,7 +603,7 @@ TRANS(OpenCLTSClient) (char *address)
#ifdef TRANS_SERVER
XtransConnInfo
-TRANS(OpenCLTSServer) (char *address)
+TRANS(OpenCLTSServer) (const char *address)
{
prmsg (2,"OpenCLTSServer(%s)\n", address);
@@ -615,7 +616,7 @@ TRANS(OpenCLTSServer) (char *address)
#ifdef TRANS_REOPEN
XtransConnInfo
-TRANS(ReopenCOTSServer) (int trans_id, int fd, char *port)
+TRANS(ReopenCOTSServer) (int trans_id, int fd, const char *port)
{
prmsg (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
@@ -623,7 +624,7 @@ TRANS(ReopenCOTSServer) (int trans_id, int fd, char *port)
}
XtransConnInfo
-TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port)
+TRANS(ReopenCLTSServer) (int trans_id, int fd, const char *port)
{
prmsg (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
@@ -742,7 +743,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
#ifdef TRANS_SERVER
int
-TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(CreateListener) (XtransConnInfo ciptr, const char *port, unsigned int flags)
{
return ciptr->transptr->CreateListener (ciptr, port, flags);
@@ -851,7 +852,7 @@ TRANS(Accept) (XtransConnInfo ciptr, int *status)
#ifdef TRANS_CLIENT
int
-TRANS(Connect) (XtransConnInfo ciptr, char *address)
+TRANS(Connect) (XtransConnInfo ciptr, const char *address)
{
char *protocol;
@@ -1073,7 +1074,8 @@ complete_network_count (void)
static int
-receive_listening_fds(char* port, XtransConnInfo* temp_ciptrs, int* count_ret)
+receive_listening_fds(const char* port, XtransConnInfo* temp_ciptrs,
+ int* count_ret)
{
#ifdef HAVE_SYSTEMD_DAEMON
@@ -1150,8 +1152,8 @@ extern int xquartz_launchd_fd;
#endif
int
-TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
- XtransConnInfo **ciptrs_ret)
+TRANS(MakeAllCOTSServerListeners) (const char *port, int *partial,
+ int *count_ret, XtransConnInfo **ciptrs_ret)
{
char buffer[256]; /* ??? What size ?? */
@@ -1281,8 +1283,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
}
int
-TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
- XtransConnInfo **ciptrs_ret)
+TRANS(MakeAllCLTSServerListeners) (const char *port, int *partial,
+ int *count_ret, XtransConnInfo **ciptrs_ret)
{
char buffer[256]; /* ??? What size ?? */
diff --git a/X11/xtrans/Xtrans.h b/X11/xtrans/Xtrans.h
index 5807b6728..6decc6b3a 100644
--- a/X11/xtrans/Xtrans.h
+++ b/X11/xtrans/Xtrans.h
@@ -236,7 +236,7 @@ void TRANS(FreeConnInfo) (
#ifdef TRANS_CLIENT
XtransConnInfo TRANS(OpenCOTSClient)(
- char * /* address */
+ const char * /* address */
);
#endif /* TRANS_CLIENT */
@@ -244,7 +244,7 @@ XtransConnInfo TRANS(OpenCOTSClient)(
#ifdef TRANS_SERVER
XtransConnInfo TRANS(OpenCOTSServer)(
- char * /* address */
+ const char * /* address */
);
#endif /* TRANS_SERVER */
@@ -252,7 +252,7 @@ XtransConnInfo TRANS(OpenCOTSServer)(
#ifdef TRANS_CLIENT
XtransConnInfo TRANS(OpenCLTSClient)(
- char * /* address */
+ const char * /* address */
);
#endif /* TRANS_CLIENT */
@@ -260,7 +260,7 @@ XtransConnInfo TRANS(OpenCLTSClient)(
#ifdef TRANS_SERVER
XtransConnInfo TRANS(OpenCLTSServer)(
- char * /* address */
+ const char * /* address */
);
#endif /* TRANS_SERVER */
@@ -270,13 +270,13 @@ XtransConnInfo TRANS(OpenCLTSServer)(
XtransConnInfo TRANS(ReopenCOTSServer)(
int, /* trans_id */
int, /* fd */
- char * /* port */
+ const char * /* port */
);
XtransConnInfo TRANS(ReopenCLTSServer)(
int, /* trans_id */
int, /* fd */
- char * /* port */
+ const char * /* port */
);
int TRANS(GetReopenInfo)(
@@ -299,7 +299,7 @@ int TRANS(SetOption)(
int TRANS(CreateListener)(
XtransConnInfo, /* ciptr */
- char *, /* port */
+ const char *, /* port */
unsigned int /* flags */
);
@@ -330,7 +330,7 @@ XtransConnInfo TRANS(Accept)(
int TRANS(Connect)(
XtransConnInfo, /* ciptr */
- char * /* address */
+ const char * /* address */
);
#endif /* TRANS_CLIENT */
@@ -405,14 +405,14 @@ int TRANS(GetConnectionNumber)(
#ifdef TRANS_SERVER
int TRANS(MakeAllCOTSServerListeners)(
- char *, /* port */
+ const char *, /* port */
int *, /* partial */
int *, /* count_ret */
XtransConnInfo ** /* ciptrs_ret */
);
int TRANS(MakeAllCLTSServerListeners)(
- char *, /* port */
+ const char *, /* port */
int *, /* partial */
int *, /* count_ret */
XtransConnInfo ** /* ciptrs_ret */
diff --git a/X11/xtrans/Xtransint.h b/X11/xtrans/Xtransint.h
index 4c670b88a..5ff824de0 100644
--- a/X11/xtrans/Xtransint.h
+++ b/X11/xtrans/Xtransint.h
@@ -163,9 +163,9 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCOTSClient)(
struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
#endif /* TRANS_CLIENT */
@@ -174,9 +174,9 @@ typedef struct _Xtransport {
const char ** nolisten;
XtransConnInfo (*OpenCOTSServer)(
struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
#endif /* TRANS_SERVER */
@@ -185,9 +185,9 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCLTSClient)(
struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
#endif /* TRANS_CLIENT */
@@ -196,9 +196,9 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCLTSServer)(
struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
#endif /* TRANS_SERVER */
@@ -209,13 +209,13 @@ typedef struct _Xtransport {
XtransConnInfo (*ReopenCOTSServer)(
struct _Xtransport *, /* transport */
int, /* fd */
- char * /* port */
+ const char * /* port */
);
XtransConnInfo (*ReopenCLTSServer)(
struct _Xtransport *, /* transport */
int, /* fd */
- char * /* port */
+ const char * /* port */
);
#endif /* TRANS_REOPEN */
@@ -233,7 +233,7 @@ typedef struct _Xtransport {
int (*CreateListener)(
XtransConnInfo, /* connection */
- char *, /* port */
+ const char *, /* port */
unsigned int /* flags */
);
@@ -252,8 +252,8 @@ typedef struct _Xtransport {
int (*Connect)(
XtransConnInfo, /* connection */
- char *, /* host */
- char * /* port */
+ const char *, /* host */
+ const char * /* port */
);
#endif /* TRANS_CLIENT */
diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c
index 4deb86c40..3217506c3 100644
--- a/X11/xtrans/Xtranslcl.c
+++ b/X11/xtrans/Xtranslcl.c
@@ -123,7 +123,7 @@ static int TRANS(LocalClose)(XtransConnInfo ciptr);
/* Type Not Supported */
static int
-TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, char *port _X_UNUSED)
+TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, const char *port _X_UNUSED)
{
return -1;
@@ -132,7 +132,8 @@ TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, char *port _X_UNUSED)
#ifdef TRANS_REOPEN
static int
-TRANS(ReopenFail)(XtransConnInfo ciptr _X_UNUSED, int fd _X_UNUSED, char *port _X_UNUSED)
+TRANS(ReopenFail)(XtransConnInfo ciptr _X_UNUSED, int fd _X_UNUSED,
+ const char *port _X_UNUSED)
{
return 0;
@@ -158,7 +159,8 @@ TRANS(LocalSendFdInvalid)(XtransConnInfo ciptr, int fd, int do_close)
static int
-TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
+TRANS(FillAddrInfo)(XtransConnInfo ciptr,
+ const char *sun_path, const char *peer_sun_path)
{
struct sockaddr_un *sunaddr;
@@ -316,7 +318,7 @@ static void _dummy(int sig _X_UNUSED)
#ifdef TRANS_CLIENT
static int
-TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
+TRANS(PTSOpenClient)(XtransConnInfo ciptr, const char *port)
{
#ifdef PTSNODENAME
@@ -468,7 +470,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
#ifdef TRANS_SERVER
static int
-TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
+TRANS(PTSOpenServer)(XtransConnInfo ciptr, const char *port)
{
#ifdef PTSNODENAME
@@ -669,7 +671,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
#ifdef TRANS_CLIENT
static int
-TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
+TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, const char *port)
{
#ifdef NAMEDNODENAME
@@ -806,7 +808,7 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
#endif
static int
-TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
+TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, const char *port)
{
#ifdef NAMEDNODENAME
int fd;
@@ -1012,7 +1014,7 @@ named_spipe(int fd, char *path)
#ifdef TRANS_CLIENT
static int
-TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
+TRANS(SCOOpenClient)(XtransConnInfo ciptr, const char *port)
{
#ifdef SCORNODENAME
int fd, server, fl, ret;
@@ -1100,7 +1102,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
#ifdef TRANS_SERVER
static int
-TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
+TRANS(SCOOpenServer)(XtransConnInfo ciptr, const char *port)
{
#ifdef SCORNODENAME
char serverR_path[64];
@@ -1276,7 +1278,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
#ifdef LOCAL_TRANS_PTS
static int
-TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, const char *port)
{
#ifdef PTSNODENAME
@@ -1317,7 +1319,7 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#ifdef LOCAL_TRANS_NAMED
static int
-TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, char *port)
+TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, const char *port)
{
#ifdef NAMEDNODENAME
@@ -1358,7 +1360,7 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, char *port)
#ifdef LOCAL_TRANS_SCO
static int
-TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, const char *port)
{
#ifdef SCORNODENAME
@@ -1407,7 +1409,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_CLIENT
int (*devcotsopenclient)(
- XtransConnInfo, char * /*port*/
+ XtransConnInfo, const char * /*port*/
);
#endif /* TRANS_CLIENT */
@@ -1415,7 +1417,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_SERVER
int (*devcotsopenserver)(
- XtransConnInfo, char * /*port*/
+ XtransConnInfo, const char * /*port*/
);
#endif /* TRANS_SERVER */
@@ -1423,7 +1425,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_CLIENT
int (*devcltsopenclient)(
- XtransConnInfo, char * /*port*/
+ XtransConnInfo, const char * /*port*/
);
#endif /* TRANS_CLIENT */
@@ -1431,7 +1433,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_SERVER
int (*devcltsopenserver)(
- XtransConnInfo, char * /*port*/
+ XtransConnInfo, const char * /*port*/
);
#endif /* TRANS_SERVER */
@@ -1441,13 +1443,13 @@ typedef struct _LOCALtrans2dev {
int (*devcotsreopenserver)(
XtransConnInfo,
int, /* fd */
- char * /* port */
+ const char * /* port */
);
int (*devcltsreopenserver)(
XtransConnInfo,
int, /* fd */
- char * /* port */
+ const char * /* port */
);
#endif /* TRANS_REOPEN */
@@ -1757,7 +1759,7 @@ TRANS(LocalGetNextTransport)(void)
*/
static int
-HostReallyLocal (char *host)
+HostReallyLocal (const char *host)
{
/*
@@ -1787,7 +1789,8 @@ HostReallyLocal (char *host)
static XtransConnInfo
-TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
+TRANS(LocalOpenClient)(int type, const char *protocol,
+ const char *host, const char *port)
{
LOCALtrans2dev *transptr;
@@ -1882,7 +1885,8 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, char *port)
+TRANS(LocalOpenServer)(int type, const char *protocol,
+ const char *host _X_UNUSED, const char *port)
{
int i;
@@ -1945,7 +1949,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, char *por
#ifdef TRANS_REOPEN
static XtransConnInfo
-TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
+TRANS(LocalReopenServer)(int type, int index, int fd, const char *port)
{
XtransConnInfo ciptr;
@@ -1997,8 +2001,8 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
- char *host, char *port)
+TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, const char *protocol,
+ const char *host, const char *port)
{
prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
@@ -2012,8 +2016,8 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
- char *host, char *port)
+TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, const char *protocol,
+ const char *host, const char *port)
{
char *typetocheck = NULL;
@@ -2056,8 +2060,8 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
- char *host, char *port)
+TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, const char *protocol,
+ const char *host, const char *port)
{
prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
@@ -2071,8 +2075,8 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, char *protocol,
- char *host, char *port)
+TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, const char *protocol,
+ const char *host, const char *port)
{
prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
@@ -2086,7 +2090,7 @@ TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, char *protocol,
#ifdef TRANS_REOPEN
static XtransConnInfo
-TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
+TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, const char *port)
{
int index;
@@ -2110,7 +2114,7 @@ TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
}
static XtransConnInfo
-TRANS(LocalReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
+TRANS(LocalReopenCLTSServer)(Xtransport *thistrans, int fd, const char *port)
{
int index;
@@ -2150,7 +2154,8 @@ TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
#ifdef TRANS_SERVER
static int
-TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags _X_UNUSED)
+TRANS(LocalCreateListener)(XtransConnInfo ciptr, const char *port,
+ unsigned int flags _X_UNUSED)
{
prmsg(2,"LocalCreateListener(%p->%d,%s)\n",ciptr,ciptr->fd,port);
@@ -2215,7 +2220,8 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
#ifdef TRANS_CLIENT
static int
-TRANS(LocalConnect)(XtransConnInfo ciptr, char *host _X_UNUSED, char *port)
+TRANS(LocalConnect)(XtransConnInfo ciptr,
+ const char *host _X_UNUSED, const char *port)
{
prmsg(2,"LocalConnect(%p->%d,%s)\n", ciptr, ciptr->fd, port);
diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c
index 6cde146cd..d830e7c6c 100644
--- a/X11/xtrans/Xtranssock.c
+++ b/X11/xtrans/Xtranssock.c
@@ -473,7 +473,7 @@ TRANS(SocketOpen) (int i, int type)
#ifdef TRANS_REOPEN
static XtransConnInfo
-TRANS(SocketReopen) (int i _X_UNUSED, int type, int fd, char *port)
+TRANS(SocketReopen) (int i _X_UNUSED, int type, int fd, const char *port)
{
XtransConnInfo ciptr;
@@ -596,8 +596,8 @@ TRANS(SocketOpenCOTSClientBase) (const char *transname, const char *protocol,
}
static XtransConnInfo
-TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
- char *host, char *port)
+TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, const char *protocol,
+ const char *host, const char *port)
{
return TRANS(SocketOpenCOTSClientBase)(
thistrans->TransName, protocol, host, port, -1);
@@ -610,8 +610,8 @@ TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
- char *host, char *port)
+TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol,
+ const char *host, const char *port)
{
XtransConnInfo ciptr;
@@ -677,8 +677,8 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
- char *host, char *port)
+TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, const char *protocol,
+ const char *host, const char *port)
{
XtransConnInfo ciptr;
@@ -716,8 +716,8 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
- char *host, char *port)
+TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, const char *protocol,
+ const char *host, const char *port)
{
XtransConnInfo ciptr;
@@ -762,7 +762,7 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_REOPEN
static XtransConnInfo
-TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
+TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, const char *port)
{
XtransConnInfo ciptr;
@@ -796,7 +796,7 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
}
static XtransConnInfo
-TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
+TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, const char *port)
{
XtransConnInfo ciptr;
@@ -947,7 +947,8 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
#ifdef TCPCONN
static int
-TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, const char *port,
+ unsigned int flags)
{
#if defined(IPv6) && defined(AF_INET6)
@@ -1075,7 +1076,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
#ifdef UNIXCONN
static int
-TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
+TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, const char *port,
unsigned int flags)
{
@@ -1431,7 +1432,8 @@ static struct addrlist *addrlist = NULL;
static int
-TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
+TRANS(SocketINETConnect) (XtransConnInfo ciptr,
+ const char *host, const char *port)
{
struct sockaddr * socketaddr = NULL;
@@ -1813,7 +1815,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
*/
static int
-UnixHostReallyLocal (char *host)
+UnixHostReallyLocal (const char *host)
{
char hostnamebuf[256];
@@ -1944,7 +1946,8 @@ UnixHostReallyLocal (char *host)
}
static int
-TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
+TRANS(SocketUNIXConnect) (XtransConnInfo ciptr,
+ const char *host, const char *port)
{
struct sockaddr_un sockname;
diff --git a/X11/xtrans/doc/xtrans.xml b/X11/xtrans/doc/xtrans.xml
index 59daa3fc0..e3bc1c9a0 100644
--- a/X11/xtrans/doc/xtrans.xml
+++ b/X11/xtrans/doc/xtrans.xml
@@ -187,35 +187,35 @@ points for a single transport. This record is defined as:
<synopsis>
typedef struct _Xtransport {
- char *TransName;
+ const char *TransName;
int flags;
XtransConnInfo (*OpenCOTSClient)(
- struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ struct _Xtransport *, /* transport */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
XtransConnInfo (*OpenCOTSServer)(
- struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ struct _Xtransport *, /* transport */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
XtransConnInfo (*OpenCLTSClient)(
- struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ struct _Xtransport *, /* transport */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
XtransConnInfo (*OpenCLTSServer)(
- struct _Xtransport *, /* transport */
- char *, /* protocol */
- char *, /* host */
- char * /* port */
+ struct _Xtransport *, /* transport */
+ const char *, /* protocol */
+ const char *, /* host */
+ const char * /* port */
);
int (*SetOption)(
@@ -226,8 +226,8 @@ typedef struct _Xtransport {
int (*CreateListener)(
XtransConnInfo, /* connection */
- char *, /* port */
- int /* flags */
+ const char *, /* port */
+ int /* flags */
);
int (*ResetListener)(
@@ -240,8 +240,8 @@ typedef struct _Xtransport {
int (*Connect)(
XtransConnInfo, /* connection */
- char *, /* host */
- char * /* port */
+ const char *, /* host */
+ const char * /* port */
);
int (*BytesReadable)(
@@ -393,7 +393,7 @@ errno will be available for debugging purposes.
<funcsynopsis id='TRANSOpenCOTSClient'>
<funcprototype>
<funcdef>XtransConnInfo <function>TRANS(OpenCOTSClient)</function></funcdef>
- <paramdef>char *<parameter>address</parameter></paramdef>
+ <paramdef>const char *<parameter>address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -408,7 +408,7 @@ success, or <constant>NULL</constant> on failure.
<funcsynopsis id='TRANSOpenCOTSServer'>
<funcprototype>
<funcdef>XtransConnInfo <function>TRANS(OpenCOTSServer)</function></funcdef>
- <paramdef>char *<parameter>address</parameter></paramdef>
+ <paramdef>const char *<parameter>address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -423,7 +423,7 @@ on failure.
<funcsynopsis id='TRANSOpenCLTSClient'>
<funcprototype>
<funcdef>XtransConnInfo <function>TRANS(OpenCLTSClient)</function></funcdef>
- <paramdef>char *<parameter>address</parameter></paramdef>
+ <paramdef>const char *<parameter>address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -438,7 +438,7 @@ function returns an opaque transport connection object on success, or
<funcsynopsis id='TRANSOpenCLTSServer'>
<funcprototype>
<funcdef>XtransConnInfo <function>TRANS(OpenCLTSServer)</function></funcdef>
- <paramdef>char *<parameter>address</parameter></paramdef>
+ <paramdef>const char *<parameter>address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -480,7 +480,7 @@ Based on current usage, the complimentary function
<funcprototype>
<funcdef>int <function>TRANS(CreateListener)</function></funcdef>
<paramdef>XtransConnInfo <parameter>connection</parameter></paramdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@@ -542,7 +542,7 @@ new opaque transport connection object upon success,
<funcprototype>
<funcdef>int <function>TRANS(Connect)</function></funcdef>
<paramdef>XtransConnInfo <parameter>connection</parameter></paramdef>
- <paramdef>char *<parameter>address</parameter></paramdef>
+ <paramdef>const char *<parameter>address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -712,7 +712,7 @@ Returns the file descriptor associated with this transport.
<funcsynopsis id='TRANSMakeAllCOTSServerListeners'>
<funcprototype>
<funcdef>int <function>TRANS(MakeAllCOTSServerListeners)</function></funcdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
<paramdef>int *<parameter>partial_ret</parameter></paramdef>
<paramdef>int *<parameter>count_ret</parameter></paramdef>
<paramdef>XtransConnInfo **<parameter>connections_ret</parameter></paramdef>
@@ -731,7 +731,7 @@ is the list of transports.
<funcsynopsis id='TRANSMakeAllCLTSServerListeners'>
<funcprototype>
<funcdef>int <function>TRANS(MakeAllCLTSServerListeners)</function></funcdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
<paramdef>int *<parameter>partial_ret</parameter></paramdef>
<paramdef>int *<parameter>count_ret</parameter></paramdef>
<paramdef>XtransConnInfo **<parameter>connections_ret</parameter></paramdef>
@@ -826,9 +826,9 @@ the <code>#ifdef SUNSYSV</code> should be handled inside these functions.
<funcprototype>
<funcdef>XtransConnInfo *<function>OpenCOTSClient</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
- <paramdef>char *<parameter>protocol</parameter></paramdef>
- <paramdef>char *<parameter>host</parameter></paramdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>protocol</parameter></paramdef>
+ <paramdef>const char *<parameter>host</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -850,9 +850,9 @@ this function.
<funcprototype>
<funcdef>XtransConnInfo *<function>OpenCOTSServer</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
- <paramdef>char *<parameter>protocol</parameter></paramdef>
- <paramdef>char *<parameter>host</parameter></paramdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>protocol</parameter></paramdef>
+ <paramdef>const char *<parameter>host</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -872,9 +872,9 @@ will open the transport.
<funcprototype>
<funcdef>XtransConnInfo *<function>OpenCLTSClient</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
- <paramdef>char *<parameter>protocol</parameter></paramdef>
- <paramdef>char *<parameter>host</parameter></paramdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>protocol</parameter></paramdef>
+ <paramdef>const char *<parameter>host</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -896,9 +896,9 @@ in by this function.
<funcprototype>
<funcdef>XtransConnInfo *<function>OpenCLTSServer</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
- <paramdef>char *<parameter>protocol</parameter></paramdef>
- <paramdef>char *<parameter>host</parameter></paramdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>protocol</parameter></paramdef>
+ <paramdef>const char *<parameter>host</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -935,7 +935,7 @@ different transport type is added, or a transport dependent option is defined.
<funcprototype>
<funcdef>int <function>CreateListener</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
- <paramdef>char <parameter>*port</parameter></paramdef>
+ <paramdef>const char <parameter>*port</parameter></paramdef>
<paramdef>int <parameter>flags</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@@ -987,8 +987,8 @@ structure describing the new endpoint is returned from this function
<funcprototype>
<funcdef>int <function>Connect</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
- <paramdef>char *<parameter>host</parameter></paramdef>
- <paramdef>char *<parameter>port</parameter></paramdef>
+ <paramdef>const char *<parameter>host</parameter></paramdef>
+ <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>