Commit 3bd236a0 authored by Kaleb Keithley Keithley's avatar Kaleb Keithley Keithley
Browse files

XFree86 4.3.0.1

parent 26781c4f
This diff is collapsed.
......@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/lib/xtrans/Xtrans.h,v 3.18 2001/12/14 19:57:04 dawes Exp $ */
/* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
*
......@@ -62,77 +63,104 @@ from The Open Group.
*/
#ifdef X11_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _X11Trans##func
#else
#define TRANS(func) _X11Trans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_X11Trans";
#endif
#endif /* X11_t */
#ifdef XSERV_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _XSERVTrans##func
#else
#define TRANS(func) _XSERVTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_XSERVTrans";
#endif
#define X11_t
#endif /* X11_t */
#ifdef XIM_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _XimXTrans##func
#else
#define TRANS(func) _XimXTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_XimTrans";
#endif
#endif /* XIM_t */
#ifdef FS_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _FSTrans##func
#else
#define TRANS(func) _FSTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_FSTrans";
#endif
#endif /* FS_t */
#ifdef FONT_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _FontTrans##func
#else
#define TRANS(func) _FontTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_FontTrans";
#endif
#endif /* FONT_t */
#ifdef ICE_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _IceTrans##func
#else
#define TRANS(func) _IceTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_IceTrans";
#endif
#endif /* ICE_t */
#ifdef TEST_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _TESTTrans##func
#else
#define TRANS(func) _TESTTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_TESTTrans";
#endif
#endif /* TEST_t */
#ifdef LBXPROXY_t
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _LBXPROXYTrans##func
#else
#define TRANS(func) _LBXPROXYTrans/**/func
#endif
#define X11_t /* The server defines this - so should the LBX proxy */
#ifdef XTRANSDEBUG
static char* __xtransname = "_LBXPROXYTrans";
#endif
#endif /* LBXPROXY_t */
#if !defined(TRANS)
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
#if !defined(UNIXCPP) || defined(ANSICPP)
#define TRANS(func) _XTrans##func
#else
#define TRANS(func) _XTrans/**/func
#endif
#ifdef XTRANSDEBUG
static char* __xtransname = "_XTrans";
#endif
#endif /* !TRANS */
......@@ -173,7 +201,11 @@ struct iovec {
};
#else
#ifndef Lynx
#include <sys/uio.h>
#else
#include <uio.h>
#endif
#endif
typedef struct _XtransConnInfo *XtransConnInfo;
......@@ -193,6 +225,7 @@ typedef struct _XtransConnInfo *XtransConnInfo;
#define TRANS_CONNECT_FAILED -1
#define TRANS_TRY_CONNECT_AGAIN -2
#define TRANS_IN_PROGRESS -3
/*
......@@ -225,12 +258,14 @@ typedef struct _XtransConnInfo *XtransConnInfo;
* Function prototypes for the exposed interface
*/
void TRANS(FreeConnInfo) (
XtransConnInfo /* ciptr */
);
#ifdef TRANS_CLIENT
XtransConnInfo TRANS(OpenCOTSClient)(
#if NeedFunctionPrototypes
char * /* address */
#endif
);
#endif /* TRANS_CLIENT */
......@@ -238,9 +273,7 @@ XtransConnInfo TRANS(OpenCOTSClient)(
#ifdef TRANS_SERVER
XtransConnInfo TRANS(OpenCOTSServer)(
#if NeedFunctionPrototypes
char * /* address */
#endif
);
#endif /* TRANS_SERVER */
......@@ -248,9 +281,7 @@ XtransConnInfo TRANS(OpenCOTSServer)(
#ifdef TRANS_CLIENT
XtransConnInfo TRANS(OpenCLTSClient)(
#if NeedFunctionPrototypes
char * /* address */
#endif
);
#endif /* TRANS_CLIENT */
......@@ -258,9 +289,7 @@ XtransConnInfo TRANS(OpenCLTSClient)(
#ifdef TRANS_SERVER
XtransConnInfo TRANS(OpenCLTSServer)(
#if NeedFunctionPrototypes
char * /* address */
#endif
);
#endif /* TRANS_SERVER */
......@@ -268,61 +297,51 @@ XtransConnInfo TRANS(OpenCLTSServer)(
#ifdef TRANS_REOPEN
XtransConnInfo TRANS(ReopenCOTSServer)(
#if NeedFunctionPrototypes
int, /* trans_id */
int, /* fd */
char * /* port */
#endif
);
XtransConnInfo TRANS(ReopenCLTSServer)(
#if NeedFunctionPrototypes
int, /* trans_id */
int, /* fd */
char * /* port */
#endif
);
int TRANS(GetReopenInfo)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
int *, /* trans_id */
int *, /* fd */
char ** /* port */
#endif
);
#endif /* TRANS_REOPEN */
int TRANS(SetOption)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
int, /* option */
int /* arg */
#endif
);
#ifdef TRANS_SERVER
int TRANS(CreateListener)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
char * /* port */
#endif
);
int TRANS(NoListen) (
char* /* protocol*/
);
int TRANS(ResetListener)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
XtransConnInfo TRANS(Accept)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
int * /* status */
#endif
);
#endif /* TRANS_SERVER */
......@@ -330,119 +349,89 @@ XtransConnInfo TRANS(Accept)(
#ifdef TRANS_CLIENT
int TRANS(Connect)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
char * /* address */
#endif
);
#endif /* TRANS_CLIENT */
int TRANS(BytesReadable)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
BytesReadable_t * /* pend */
#endif
);
int TRANS(Read)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
char *, /* buf */
int /* size */
#endif
);
int TRANS(Write)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
char *, /* buf */
int /* size */
#endif
);
int TRANS(Readv)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
struct iovec *, /* buf */
int /* size */
#endif
);
int TRANS(Writev)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
struct iovec *, /* buf */
int /* size */
#endif
);
int TRANS(Disconnect)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
int TRANS(Close)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
int TRANS(CloseForCloning)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
int TRANS(IsLocal)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
int TRANS(GetMyAddr)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
int *, /* familyp */
int *, /* addrlenp */
Xtransaddr ** /* addrp */
#endif
);
int TRANS(GetPeerAddr)(
#if NeedFunctionPrototypes
XtransConnInfo, /* ciptr */
int *, /* familyp */
int *, /* addrlenp */
Xtransaddr ** /* addrp */
#endif
);
int TRANS(GetConnectionNumber)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
#ifdef TRANS_SERVER
int TRANS(MakeAllCOTSServerListeners)(
#if NeedFunctionPrototypes
char *, /* port */
int *, /* partial */
int *, /* count_ret */
XtransConnInfo ** /* ciptrs_ret */
#endif
);
int TRANS(MakeAllCLTSServerListeners)(
#if NeedFunctionPrototypes
char *, /* port */
int *, /* partial */
int *, /* count_ret */
XtransConnInfo ** /* ciptrs_ret */
#endif
);
#endif /* TRANS_SERVER */
......@@ -455,11 +444,9 @@ int TRANS(MakeAllCLTSServerListeners)(
#ifdef X11_t
int TRANS(ConvertAddress)(
#if NeedFunctionPrototypes
int *, /* familyp */
int *, /* addrlenp */
Xtransaddr ** /* addrp */
#endif
);
#endif /* X11_t */
......@@ -468,20 +455,22 @@ int TRANS(ConvertAddress)(
char *
TRANS(GetMyNetworkId)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
char *
TRANS(GetPeerNetworkId)(
#if NeedFunctionPrototypes
XtransConnInfo /* ciptr */
#endif
);
#endif /* ICE_t */
int
TRANS(GetHostname) (
char * /* buf */,
int /* maxlen */
);
#if defined(WIN32) && (defined(TCPCONN) || defined(DNETCONN))
int TRANS(WSAStartup)();
#endif
......
......@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/lib/xtrans/Xtransdnet.c,v 3.7 2002/11/26 01:12:30 dawes Exp $ */
/* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
*
......@@ -100,19 +101,17 @@ from The Open Group.
*/
static int
TRANS(DNETGetAddr) (ciptr)
XtransConnInfo ciptr;
TRANS(DNETGetAddr) (XtransConnInfo ciptr)
{
struct sockaddr_dn sockname;
int namelen = sizeof(sockname);
PRMSG (3,"TRANS(DNETGetAddr) (%x)\n", ciptr, 0, 0);
PRMSG (3,"DNETGetAddr(%x)\n", ciptr, 0, 0);
if (getsockname (ciptr->fd, (struct sockaddr *) &sockname, &namelen) < 0)
{
PRMSG (1,"TRANS(DNETGetAddr): getsockname() failed: %d\n",
PRMSG (1,"DNETGetAddr: getsockname() failed: %d\n",
EGET(), 0, 0);
return -1;
}
......@@ -122,9 +121,9 @@ XtransConnInfo ciptr;
* Everything looks good: fill in the XtransConnInfo structure.
*/
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
{
PRMSG (1, "TRANS(DNETGetAddr): Can't allocate space for the addr\n",
PRMSG (1, "DNETGetAddr: Can't allocate space for the addr\n",
0, 0, 0);
return -1;
}
......@@ -143,19 +142,17 @@ XtransConnInfo ciptr;
*/
static int
TRANS(DNETGetPeerAddr) (ciptr)
XtransConnInfo ciptr;
TRANS(DNETGetPeerAddr) (XtransConnInfo ciptr)
{
struct sockaddr_dn sockname;
int namelen = sizeof(sockname);
PRMSG (3,"TRANS(DNETGetPeerAddr) (%x)\n", ciptr, 0, 0);
PRMSG (3,"DNETGetPeerAddr(%x)\n", ciptr, 0, 0);
if (getpeername (ciptr->fd, (struct sockaddr *) &sockname, &namelen) < 0)
{
PRMSG (1,"TRANS(DNETGetPeerAddr): getpeername() failed: %d\n",
PRMSG (1,"DNETGetPeerAddr: getpeername() failed: %d\n",
EGET(), 0, 0);
return -1;
}
......@@ -164,10 +161,10 @@ XtransConnInfo ciptr;
* Everything looks good: fill in the XtransConnInfo structure.
*/
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
{
PRMSG (1,
"TRANS(DNETGetPeerAddr): Can't allocate space for the addr\n",
"DNETGetPeerAddr: Can't allocate space for the addr\n",
0, 0, 0);
return -1;
}
......@@ -182,22 +179,18 @@ XtransConnInfo ciptr;
#ifdef TRANS_CLIENT
static XtransConnInfo
TRANS(DNETOpenCOTSClient) (thistrans, protocol, host, port)
Xtransport *thistrans;
char *protocol;
char *host;
char *port;
TRANS(DNETOpenCOTSClient) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
PRMSG (2,"TRANS(DNETOpenCOTSClient) (%s,%s,%s)\n", protocol, host, port);
PRMSG (2,"DNETOpenCOTSClient(%s,%s,%s)\n", protocol, host, port);
if ((ciptr = (XtransConnInfo) calloc (
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
PRMSG (1, "TRANS(DNETOpenCOTSClient): malloc failed\n", 0, 0, 0);
PRMSG (1, "DNETOpenCOTSClient: malloc failed\n", 0, 0, 0);
return NULL;
}
......@@ -214,28 +207,24 @@ char *port;
#ifdef TRANS_SERVER
static XtransConnInfo
TRANS(DNETOpenCOTSServer) (thistrans, protocol, host, port)
Xtransport *thistrans;
char *protocol;
char *host;
char *port;
TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
PRMSG (2,"TRANS(DNETOpenCOTSServer) (%s,%s,%s)\n", protocol, host, port);
PRMSG (2,"DNETOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
if ((ciptr = (XtransConnInfo) calloc (
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
PRMSG (1, "TRANS(DNETOpenCOTSServer): malloc failed\n", 0, 0, 0);
PRMSG (1, "DNETOpenCOTSServer: malloc failed\n", 0, 0, 0);
return NULL;
}
if ((ciptr->fd = socket (AF_DECnet, SOCK_STREAM, 0)) < 0)
{
free ((char *) ciptr);
xfree ((char *) ciptr);
return NULL;
}
......@@ -250,22 +239,18 @@ char *port;
#ifdef TRANS_CLIENT
static XtransConnInfo
TRANS(DNETOpenCLTSClient) (thistrans, protocol, host, port)
Xtransport *thistrans;
char *protocol;
char *host;
char *port;
TRANS(DNETOpenCLTSClient) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
PRMSG (2,"TRANS(DNETOpenCLTSClient) (%s,%s,%s)\n", protocol, host, port);
PRMSG (2,"DNETOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
if ((ciptr = (XtransConnInfo) calloc (
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof (struct _XtransConnInfo))) == NULL)
{
PRMSG (1, "TRANS(DNETOpenCLTSClient): malloc failed\n", 0, 0, 0);
PRMSG (1, "DNETOpenCLTSClient: malloc failed\n", 0, 0, 0);
return NULL;
}
......@@ -282,17 +267,13 @@ char *port;
#ifdef TRANS_SERVER
static XtransConnInfo
TRANS(DNETOpenCLTSServer) (thistrans, protocol, host, port)
Xtransport *thistrans;
char *protocol;
char *host;
char *port;
TRANS(DNETOpenCLTSServer) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
/* NEED TO IMPLEMENT */
PRMSG (2,"TRANS(DNETOpenCLTSServer) (%s,%s,%s)\n", protocol, host, port);
PRMSG (2,"DNETOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
return NULL;
}
......@@ -302,21 +283,17 @@ char *port;
#ifdef TRANS_REOPEN
static XtransConnInfo
TRANS(DNETReopenCOTSServer) (thistrans, fd, port)
Xtransport *thistrans;
int fd;
char *port;
TRANS(DNETReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
{
XtransConnInfo ciptr;
PRMSG (2,"TRANS(DNETReopenCOTSServer) (%d, %s)\n", fd, port, 0);
PRMSG (2,"DNETReopenCOTSServer(%d,%s)\n", fd, port, 0);
if ((ciptr = (XtransConnInfo) calloc (
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
PRMSG (1, "TRANS(DNETReopenCOTSServer): malloc failed\n", 0, 0, 0);
PRMSG (1, "DNETReopenCOTSServer: malloc failed\n", 0, 0, 0);
return NULL;
}
......@@ -327,21 +304,17 @@ char *port;
}
static XtransConnInfo
TRANS(DNETReopenCLTSServer) (thistrans, fd, port)
Xtransport *thistrans;
int fd;
char *port;
TRANS(DNETReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
{
XtransConnInfo ciptr;
PRMSG (2,"TRANS(DNETReopenCLTSServer) (%d, %s)\n", fd, port, 0);
PRMSG (2,"DNETReopenCLTSServer(%d,%s)\n", fd, port, 0);
if ((ciptr = (XtransConnInfo) calloc (
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
PRMSG (1, "TRANS(DNETReopenCLTSServer): malloc failed\n", 0, 0, 0);
PRMSG (1, "DNETReopenCLTSServer: malloc failed\n", 0, 0, 0);
return NULL;
}
......@@ -355,14 +328,10 @@ char *port;
static int
TRANS(DNETSetOption) (ciptr, option, arg)
XtransConnInfo ciptr;
int option;
int arg;