Add const qualifiers to TRANS(OpenC{L,O}TS{Server,Client}) args

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Alan Coopersmith
2014-08-23 12:28:14 -07:00
parent 305d20f2ee
commit 17491de45c
4 changed files with 74 additions and 71 deletions

View File

@@ -163,9 +163,9 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCOTSClient)( XtransConnInfo (*OpenCOTSClient)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
#endif /* TRANS_CLIENT */ #endif /* TRANS_CLIENT */
@@ -174,9 +174,9 @@ typedef struct _Xtransport {
const char ** nolisten; const char ** nolisten;
XtransConnInfo (*OpenCOTSServer)( XtransConnInfo (*OpenCOTSServer)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
#endif /* TRANS_SERVER */ #endif /* TRANS_SERVER */
@@ -185,9 +185,9 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCLTSClient)( XtransConnInfo (*OpenCLTSClient)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
#endif /* TRANS_CLIENT */ #endif /* TRANS_CLIENT */
@@ -196,9 +196,9 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCLTSServer)( XtransConnInfo (*OpenCLTSServer)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
#endif /* TRANS_SERVER */ #endif /* TRANS_SERVER */

View File

@@ -123,7 +123,7 @@ static int TRANS(LocalClose)(XtransConnInfo ciptr);
/* Type Not Supported */ /* Type Not Supported */
static int 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; return -1;
@@ -159,7 +159,8 @@ TRANS(LocalSendFdInvalid)(XtransConnInfo ciptr, int fd, int do_close)
static int 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; struct sockaddr_un *sunaddr;
@@ -317,7 +318,7 @@ static void _dummy(int sig _X_UNUSED)
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static int static int
TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port) TRANS(PTSOpenClient)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef PTSNODENAME #ifdef PTSNODENAME
@@ -469,7 +470,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static int static int
TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port) TRANS(PTSOpenServer)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef PTSNODENAME #ifdef PTSNODENAME
@@ -670,7 +671,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static int static int
TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port) TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef NAMEDNODENAME #ifdef NAMEDNODENAME
@@ -807,7 +808,7 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
#endif #endif
static int static int
TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port) TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef NAMEDNODENAME #ifdef NAMEDNODENAME
int fd; int fd;
@@ -1013,7 +1014,7 @@ named_spipe(int fd, char *path)
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static int static int
TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port) TRANS(SCOOpenClient)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef SCORNODENAME #ifdef SCORNODENAME
int fd, server, fl, ret; int fd, server, fl, ret;
@@ -1101,7 +1102,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static int static int
TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port) TRANS(SCOOpenServer)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef SCORNODENAME #ifdef SCORNODENAME
char serverR_path[64]; char serverR_path[64];
@@ -1408,7 +1409,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
int (*devcotsopenclient)( int (*devcotsopenclient)(
XtransConnInfo, char * /*port*/ XtransConnInfo, const char * /*port*/
); );
#endif /* TRANS_CLIENT */ #endif /* TRANS_CLIENT */
@@ -1416,7 +1417,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
int (*devcotsopenserver)( int (*devcotsopenserver)(
XtransConnInfo, char * /*port*/ XtransConnInfo, const char * /*port*/
); );
#endif /* TRANS_SERVER */ #endif /* TRANS_SERVER */
@@ -1424,7 +1425,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
int (*devcltsopenclient)( int (*devcltsopenclient)(
XtransConnInfo, char * /*port*/ XtransConnInfo, const char * /*port*/
); );
#endif /* TRANS_CLIENT */ #endif /* TRANS_CLIENT */
@@ -1432,7 +1433,7 @@ typedef struct _LOCALtrans2dev {
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
int (*devcltsopenserver)( int (*devcltsopenserver)(
XtransConnInfo, char * /*port*/ XtransConnInfo, const char * /*port*/
); );
#endif /* TRANS_SERVER */ #endif /* TRANS_SERVER */
@@ -1758,7 +1759,7 @@ TRANS(LocalGetNextTransport)(void)
*/ */
static int static int
HostReallyLocal (char *host) HostReallyLocal (const char *host)
{ {
/* /*
@@ -1788,7 +1789,8 @@ HostReallyLocal (char *host)
static XtransConnInfo 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; LOCALtrans2dev *transptr;
@@ -1883,7 +1885,8 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo 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; int i;
@@ -1998,8 +2001,8 @@ TRANS(LocalReopenServer)(int type, int index, int fd, const char *port)
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol, TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port); prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
@@ -2013,8 +2016,8 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol, TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
char *typetocheck = NULL; char *typetocheck = NULL;
@@ -2057,8 +2060,8 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol, TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port); prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
@@ -2072,8 +2075,8 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, char *protocol, TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port); prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);

View File

@@ -596,8 +596,8 @@ TRANS(SocketOpenCOTSClientBase) (const char *transname, const char *protocol,
} }
static XtransConnInfo static XtransConnInfo
TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol, TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
return TRANS(SocketOpenCOTSClientBase)( return TRANS(SocketOpenCOTSClientBase)(
thistrans->TransName, protocol, host, port, -1); thistrans->TransName, protocol, host, port, -1);
@@ -610,8 +610,8 @@ TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo static XtransConnInfo
TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol, TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
XtransConnInfo ciptr; XtransConnInfo ciptr;
@@ -677,8 +677,8 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static XtransConnInfo static XtransConnInfo
TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol, TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
XtransConnInfo ciptr; XtransConnInfo ciptr;
@@ -716,8 +716,8 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo static XtransConnInfo
TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol, TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, const char *protocol,
char *host, char *port) const char *host, const char *port)
{ {
XtransConnInfo ciptr; XtransConnInfo ciptr;

View File

@@ -192,30 +192,30 @@ typedef struct _Xtransport {
XtransConnInfo (*OpenCOTSClient)( XtransConnInfo (*OpenCOTSClient)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
XtransConnInfo (*OpenCOTSServer)( XtransConnInfo (*OpenCOTSServer)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
XtransConnInfo (*OpenCLTSClient)( XtransConnInfo (*OpenCLTSClient)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
XtransConnInfo (*OpenCLTSServer)( XtransConnInfo (*OpenCLTSServer)(
struct _Xtransport *, /* transport */ struct _Xtransport *, /* transport */
char *, /* protocol */ const char *, /* protocol */
char *, /* host */ const char *, /* host */
char * /* port */ const char * /* port */
); );
int (*SetOption)( int (*SetOption)(
@@ -826,9 +826,9 @@ the <code>#ifdef SUNSYSV</code> should be handled inside these functions.
<funcprototype> <funcprototype>
<funcdef>XtransConnInfo *<function>OpenCOTSClient</function></funcdef> <funcdef>XtransConnInfo *<function>OpenCOTSClient</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef> <paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
<paramdef>char *<parameter>protocol</parameter></paramdef> <paramdef>const char *<parameter>protocol</parameter></paramdef>
<paramdef>char *<parameter>host</parameter></paramdef> <paramdef>const char *<parameter>host</parameter></paramdef>
<paramdef>char *<parameter>port</parameter></paramdef> <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype> </funcprototype>
</funcsynopsis> </funcsynopsis>
<para> <para>
@@ -850,9 +850,9 @@ this function.
<funcprototype> <funcprototype>
<funcdef>XtransConnInfo *<function>OpenCOTSServer</function></funcdef> <funcdef>XtransConnInfo *<function>OpenCOTSServer</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef> <paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
<paramdef>char *<parameter>protocol</parameter></paramdef> <paramdef>const char *<parameter>protocol</parameter></paramdef>
<paramdef>char *<parameter>host</parameter></paramdef> <paramdef>const char *<parameter>host</parameter></paramdef>
<paramdef>char *<parameter>port</parameter></paramdef> <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype> </funcprototype>
</funcsynopsis> </funcsynopsis>
<para> <para>
@@ -872,9 +872,9 @@ will open the transport.
<funcprototype> <funcprototype>
<funcdef>XtransConnInfo *<function>OpenCLTSClient</function></funcdef> <funcdef>XtransConnInfo *<function>OpenCLTSClient</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef> <paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
<paramdef>char *<parameter>protocol</parameter></paramdef> <paramdef>const char *<parameter>protocol</parameter></paramdef>
<paramdef>char *<parameter>host</parameter></paramdef> <paramdef>const char *<parameter>host</parameter></paramdef>
<paramdef>char *<parameter>port</parameter></paramdef> <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype> </funcprototype>
</funcsynopsis> </funcsynopsis>
<para> <para>
@@ -896,9 +896,9 @@ in by this function.
<funcprototype> <funcprototype>
<funcdef>XtransConnInfo *<function>OpenCLTSServer</function></funcdef> <funcdef>XtransConnInfo *<function>OpenCLTSServer</function></funcdef>
<paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef> <paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
<paramdef>char *<parameter>protocol</parameter></paramdef> <paramdef>const char *<parameter>protocol</parameter></paramdef>
<paramdef>char *<parameter>host</parameter></paramdef> <paramdef>const char *<parameter>host</parameter></paramdef>
<paramdef>char *<parameter>port</parameter></paramdef> <paramdef>const char *<parameter>port</parameter></paramdef>
</funcprototype> </funcprototype>
</funcsynopsis> </funcsynopsis>
<para> <para>