diff options
Diffstat (limited to 'X11/xtrans')
-rwxr-xr-x | X11/xtrans/Xtrans.c | 34 | ||||
-rw-r--r-- | X11/xtrans/Xtrans.h | 20 | ||||
-rw-r--r-- | X11/xtrans/Xtransint.h | 34 | ||||
-rw-r--r-- | X11/xtrans/Xtranslcl.c | 74 | ||||
-rw-r--r-- | X11/xtrans/Xtranssock.c | 35 | ||||
-rw-r--r-- | X11/xtrans/doc/xtrans.xml | 88 |
6 files changed, 148 insertions, 137 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c index 30f099255..b373cc417 100755 --- a/X11/xtrans/Xtrans.c +++ b/X11/xtrans/Xtrans.c @@ -190,7 +190,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) { /* @@ -396,7 +397,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; @@ -494,7 +495,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; @@ -568,7 +569,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); @@ -581,7 +582,7 @@ TRANS(OpenCOTSClient) (char *address) #ifdef TRANS_SERVER XtransConnInfo -TRANS(OpenCOTSServer) (char *address) +TRANS(OpenCOTSServer) (const char *address) { prmsg (2,"OpenCOTSServer(%s)\n", address); @@ -594,7 +595,7 @@ TRANS(OpenCOTSServer) (char *address) #ifdef TRANS_CLIENT XtransConnInfo -TRANS(OpenCLTSClient) (char *address) +TRANS(OpenCLTSClient) (const char *address) { prmsg (2,"OpenCLTSClient(%s)\n", address); @@ -607,7 +608,7 @@ TRANS(OpenCLTSClient) (char *address) #ifdef TRANS_SERVER XtransConnInfo -TRANS(OpenCLTSServer) (char *address) +TRANS(OpenCLTSServer) (const char *address) { prmsg (2,"OpenCLTSServer(%s)\n", address); @@ -620,7 +621,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); @@ -628,7 +629,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); @@ -747,7 +748,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); @@ -856,7 +857,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; @@ -1076,7 +1077,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 @@ -1153,8 +1155,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 ?? */ @@ -1284,8 +1286,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 6b2b9ec00..edd53254c 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 65f1957b9..ee4bcd926 100644 --- a/X11/xtrans/Xtranslcl.c +++ b/X11/xtrans/Xtranslcl.c @@ -129,7 +129,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; @@ -138,7 +138,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; @@ -164,7 +165,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; @@ -322,7 +324,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 @@ -474,7 +476,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 @@ -675,7 +677,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 @@ -812,7 +814,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; @@ -1018,7 +1020,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; @@ -1106,7 +1108,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]; @@ -1282,7 +1284,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 @@ -1323,7 +1325,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 @@ -1364,7 +1366,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 @@ -1413,7 +1415,7 @@ typedef struct _LOCALtrans2dev { #ifdef TRANS_CLIENT int (*devcotsopenclient)( - XtransConnInfo, char * /*port*/ + XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_CLIENT */ @@ -1421,7 +1423,7 @@ typedef struct _LOCALtrans2dev { #ifdef TRANS_SERVER int (*devcotsopenserver)( - XtransConnInfo, char * /*port*/ + XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_SERVER */ @@ -1429,7 +1431,7 @@ typedef struct _LOCALtrans2dev { #ifdef TRANS_CLIENT int (*devcltsopenclient)( - XtransConnInfo, char * /*port*/ + XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_CLIENT */ @@ -1437,7 +1439,7 @@ typedef struct _LOCALtrans2dev { #ifdef TRANS_SERVER int (*devcltsopenserver)( - XtransConnInfo, char * /*port*/ + XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_SERVER */ @@ -1447,13 +1449,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 */ @@ -1763,7 +1765,7 @@ TRANS(LocalGetNextTransport)(void) */ static int -HostReallyLocal (char *host) +HostReallyLocal (const char *host) { /* @@ -1793,7 +1795,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; @@ -1888,7 +1891,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; @@ -1951,7 +1955,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; @@ -2003,8 +2007,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); @@ -2018,8 +2022,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; @@ -2062,8 +2066,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); @@ -2077,8 +2081,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); @@ -2092,7 +2096,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; @@ -2116,7 +2120,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; @@ -2156,7 +2160,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); @@ -2221,7 +2226,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 9dda1295f..c71b4cae4 100644 --- a/X11/xtrans/Xtranssock.c +++ b/X11/xtrans/Xtranssock.c @@ -484,7 +484,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; @@ -607,8 +607,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); @@ -621,8 +621,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; @@ -688,8 +688,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; @@ -727,8 +727,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; @@ -773,7 +773,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; @@ -807,7 +807,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; @@ -962,7 +962,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) @@ -1090,7 +1091,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) { @@ -1450,7 +1451,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; @@ -1832,7 +1834,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) */ static int -UnixHostReallyLocal (char *host) +UnixHostReallyLocal (const char *host) { char hostnamebuf[256]; @@ -1963,7 +1965,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> |