tldm-universe/Ardent/UV/gcidir/include/wsckfptrs.h
2024-09-09 17:51:08 -04:00

132 lines
7.7 KiB
C
Executable File

/******************************************************************************
*
* wsckfptrs.h - Contains all the function pointers and defines for
* the rpc to dynamically link to winsock.
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description........................................
* 10/14/98 23801 SAP Change copyrights.
* 10/02/98 23765 CSM Change prototype for gethostname
* 07/25/96 18900 DJD Module Created.
*
****************************************************************************/
/* Typedefs for all TCP/IP winsock functions. They have to be pointers because we will
load the DLL only if we can do it so they must be done like this. */
typedef SOCKET (PASCAL FAR * paccept) (SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen);
typedef int (PASCAL FAR *pbind) (SOCKET s, const struct sockaddr FAR *addr, int namelen);
typedef int (PASCAL FAR * pclosesocket) (SOCKET s);
typedef int (PASCAL FAR * pconnect) (SOCKET s, const struct sockaddr FAR *name, int namelen);
typedef int (PASCAL FAR * pioctlsocket) (SOCKET s, long cmd, u_long FAR *argp);
typedef int (PASCAL FAR * pgetpeername) (SOCKET s, struct sockaddr FAR *name, int FAR * namelen);
typedef int (PASCAL FAR * pgetsockname) (SOCKET s, struct sockaddr FAR *name, int FAR * namelen);
typedef int (PASCAL FAR * pgetsockopt) (SOCKET s, int level, int optname, char FAR * optval, int FAR *optlen);
typedef u_long (PASCAL FAR * phtonl) (u_long hostlong);
typedef u_short (PASCAL FAR * phtons) (u_short hostshort);
typedef unsigned long (PASCAL FAR * pinet_addr) (const char FAR * cp);
typedef char FAR * (PASCAL FAR * pinet_ntoa) (struct in_addr in);
typedef int (PASCAL FAR * plisten) (SOCKET s, int backlog);
typedef u_long (PASCAL FAR * pntohl) (u_long netlong);
typedef u_short (PASCAL FAR * pntohs) (u_short netshort);
typedef int (PASCAL FAR * precv) (SOCKET s, char FAR * buf, int len, int flags);
typedef int (PASCAL FAR * precvfrom) (SOCKET s, char FAR * buf, int len, int flags, struct sockaddr FAR *from, int FAR * fromlen);
typedef int (PASCAL FAR * pselect) (int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, const struct timeval FAR *timeout);
typedef int (PASCAL FAR * psend) (SOCKET s, const char FAR * buf, int len, int flags);
typedef int (PASCAL FAR * psendto) (SOCKET s, const char FAR * buf, int len, int flags, const struct sockaddr FAR *to, int tolen);
typedef int (PASCAL FAR * psetsockopt) (SOCKET s, int level, int optname, const char FAR * optval, int optlen);
typedef int (PASCAL FAR * pshutdown) (SOCKET s, int how);
typedef SOCKET (PASCAL FAR * psocket) (int af, int type, int protocol);
/* Database function prototypes */
typedef struct hostent FAR * (PASCAL FAR * pgethostbyaddr) (const char FAR * addr, int len, int type);
typedef struct hostent FAR * (PASCAL FAR * pgethostbyname) (const char FAR * name);
typedef int (PASCAL FAR * pgethostname) (char FAR * name, int namelen);
typedef struct servent FAR * (PASCAL FAR * pgetservbyport) (int port, const char FAR * proto);
typedef struct servent FAR * (PASCAL FAR * pgetservbyname) (const char FAR * name, const char FAR * proto);
typedef struct protoent FAR * (PASCAL FAR * pgetprotobynumber) (int proto);
typedef struct protoent FAR * (PASCAL FAR * pgetprotobyname) (const char FAR * name);
/* Microsoft Windows Extension function prototypes */
typedef int (PASCAL FAR * pWSAStartup) (WORD wVersionRequired, LPWSADATA lpWSAData);
typedef int (PASCAL FAR * pWSACleanup) (void);
typedef void (PASCAL FAR * pWSASetLastError) (int iError);
typedef int (PASCAL FAR * pWSAGetLastError) (void);
typedef BOOL (PASCAL FAR * pWSAIsBlocking) (void);
typedef int (PASCAL FAR * pWSAUnhookBlockingHook) (void);
typedef FARPROC (PASCAL FAR * pWSASetBlockingHook) (FARPROC lpBlockFunc);
typedef int (PASCAL FAR * pWSACancelBlockingCall) (void);
typedef HANDLE (PASCAL FAR * pWSAAsyncGetServByName) (HWND hWnd, u_int wMsg, const char FAR * name, const char FAR * proto, char FAR * buf, int buflen);
typedef HANDLE (PASCAL FAR * pWSAAsyncGetServByPort) (HWND hWnd, u_int wMsg, int port, const char FAR * proto, char FAR * buf, int buflen);
typedef HANDLE (PASCAL FAR * pWSAAsyncGetProtoByName) (HWND hWnd, u_int wMsg, const char FAR * name, char FAR * buf, int buflen);
typedef HANDLE (PASCAL FAR * pWSAAsyncGetProtoByNumber) (HWND hWnd, u_int wMsg, int number, char FAR * buf, int buflen);
typedef HANDLE (PASCAL FAR * pWSAAsyncGetHostByName) (HWND hWnd, u_int wMsg, const char FAR * name, char FAR * buf, int buflen);
typedef HANDLE (PASCAL FAR * pWSAAsyncGetHostByAddr) (HWND hWnd, u_int wMsg, const char FAR * addr, int len, int type, char FAR * buf, int buflen);
typedef int (PASCAL FAR * pWSACancelAsyncRequest) (HANDLE hAsyncTaskHandle);
typedef int (PASCAL FAR * pWSAAsyncSelect) (SOCKET s, HWND hWnd, u_int wMsg, long lEvent);
typedef int (PASCAL FAR * pWSARecvEx) (SOCKET s, char FAR * buf, int len, int FAR *flags);
/* Redefine the winsock/tcpip routine to use ours pointers */
#define accept(a,b,c) daccept(a,b,c)
#define bind(a,b,c) dbind(a,b,c)
#define closesocket(a) dclosesocket(a)
#define connect(a,b,c) dconnect(a,b,c)
#define ioctlsocket(a,b,c) dioctlsocket(a,b,c)
#define getpeername(a,b,c) dgetpeername(a,b,c)
#define getsockname(a,b,c) dgetsockname(a,b,c)
#define getsockopt(a,b,c,d,e) dgetsockopt(a,b,c,d,e)
#define htonl(a) dhtonl(a)
#define htons(a) dhtons(a)
#define inet_addr(a) dinet_addr(a)
#define inet_ntoa(a) dinet_ntoa(a)
#define listen(a,b) dlisten(a,b)
#define ntohl(a) dntohl(a)
#define ntohs(a) dntohs(a)
#define recv(a,b,c,d) drecv(a,b,c,d)
#define recvfrom(a,b,c,d,e,f) drecvfrom(a,b,c,d,e,f)
#define select(a,b,c,d,e) dselect(a,b,c,d,e)
#define send(a,b,c,d) dsend(a,b,c,d)
#define sendto(a,b,c,d,e,f) dsendto(a,b,c,d,e,f)
#define setsockopt(a,b,c,d,e) dsetsockopt(a,b,c,d,e)
#define shutdown(a,b) dshutdown(a,b)
#define socket(a,b,c) dsocket(a,b,c)
#define gethostbyaddr(a,b,c) dgethostbyaddr(a,b,c)
#define gethostbyname(a) dgethostbyname(a)
#define gethostname(a,b) dgethostname(a,b)
#define getservbyport(a,b) dgetservbyport(a,b)
#define getservbyname(a,b) dgetservbyname(a,b)
#define getprotobynumber(a) dgetprotobynumber(a)
#define getprotobyname(a) dgetprotobyname(a)
#define WSAStartup(a,b) dWSAStartup(a,b)
#define WSACleanup() dWSACleanup()
#define WSASetLastError(a) dWSASetLastError(a)
#define WSAGetLastError() dWSAGetLastError()
#define WSAIsBlocking() dWSAIsBlocking()
#define WSAUnhookBlockingHook() dWSAUnhookBlockingHook()
#define WSASetBlockingHook(a) dWSASetBlockingHook(a)
#define WSACancelBlockingCall() dWSACancelBlockingCall()
#define WSAAsyncGetServByName(a,b,c,d,e,f) dWSAAsyncGetServByName(a,b,c,d,e,f)
#define WSAAsyncGetServByPort(a,b,c,d,e,f) dWSAAsyncGetServByPort(a,b,c,d,e,f)
#define WSAAsyncGetProtoByName(a,b,c,d,e) dWSAAsyncGetProtoByName(a,b,c,d,e)
#define WSAAsyncGetProtoByNumber(a,b,c,d,e) dWSAAsyncGetProtoByNumber(a,b,c,d,e)
#define WSAAsyncGetHostByName(a,b,c,d,e) dWSAAsyncGetHostByName(a,b,c,d,e)
#define WSAAsyncGetHostByAddr(a,b,c,d,e,f,g) dWSAAsyncGetHostByAddr(a,b,c,d,e,f,g)
#define WSACancelAsyncRequest(a) dWSACancelAsyncRequest(a)
#define WSAAsyncSelect(a,b,c,d) dWSAAsyncSelect(a,b,c,d)
#define WSARecvEx(a,b,c,d) dWSARecvEx(a,b,c,d)