source: trunk/gsdl/src/w32server/d_winsock.h@ 611

Last change on this file since 611 was 611, checked in by sjboddie, 25 years ago

initial commit of windows server code

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
RevLine 
[611]1#ifndef D_WINSOCK_H
2#define D_WINSOCK_H
3
4
5/* get most definitions from the real winsock */
6#include <winsock.h>
7
8
9#define D_NOERROR 0
10#define D_ERR_UNEXPECTED 1
11#define D_ERR_LOADFAILED 2
12#define D_ERR_FREELIBFAILED 3
13
14
15
16// d_LoadWinsock must be called before an normal winsock
17// functions
18
19
20// expects path to be NULL, a empty string, or a path which ends in a slash
21// returns D_NOERROR on success,
22// D_ERR_UNEXPECTED or D_ERR_LOADFAILED on failure
23int d_LoadWinsock (char *path);
24
25// returns D_NOERROR on success,
26// D_ERR_FREELIBFAILED on failure
27int d_UnloadWinsock ();
28
29
30// dynamically loaded versions of the winsock functions
31
32SOCKET d_accept (SOCKET s, struct sockaddr *addr, int *addrlen);
33int d_bind (SOCKET s, const struct sockaddr *addr, int namelen);
34int d_closesocket (SOCKET s);
35int d_connect (SOCKET s, const struct sockaddr *name, int namelen);
36int d_ioctlsocket (SOCKET s, long cmd, u_long *argp);
37int d_getpeername (SOCKET s, struct sockaddr *name, int *namelen);
38int d_getsockname (SOCKET s, struct sockaddr *name, int *namelen);
39int d_getsockopt (SOCKET s, int level, int optname, char *optval, int *optlen);
40u_long d_htonl (u_long hostlong);
41u_short d_htons (u_short hostshort);
42unsigned long d_inet_addr (const char *cp);
43char *d_inet_ntoa (struct in_addr in);
44int d_listen (SOCKET s, int backlog);
45u_long d_ntohl (u_long netlong);
46u_short d_ntohs (u_short netshort);
47int d_recv (SOCKET s, char *buf, int len, int flags);
48int d_recvfrom (SOCKET s, char *buf, int len, int flags,
49 struct sockaddr *from, int *fromlen);
50int d_select (int nfds, fd_set *readfds, fd_set *writefds,
51 fd_set *exceptfds, const struct timeval *timeout);
52int d_send (SOCKET s, const char *buf, int len, int flags);
53int d_sendto (SOCKET s, const char *buf, int len, int flags,
54 const struct sockaddr *to, int tolen);
55int d_setsockopt (SOCKET s, int level, int optname,
56 const char *optval, int optlen);
57int d_shutdown (SOCKET s, int how);
58SOCKET d_socket (int af, int type, int protocol);
59
60hostent *d_gethostbyaddr(const char *addr, int len, int type);
61hostent *d_gethostbyname(const char *name);
62int d_gethostname (char *name, int namelen);
63servent *d_getservbyport(int port, const char *proto);
64servent *d_getservbyname(const char *name, const char *proto);
65protoent *d_getprotobynumber(int proto);
66protoent *d_getprotobyname(const char *name);
67
68int d_WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData);
69int d_WSACleanup(void);
70void d_WSASetLastError(int iError);
71int d_WSAGetLastError(void);
72BOOL d_WSAIsBlocking(void);
73int d_WSAUnhookBlockingHook(void);
74FARPROC d_WSASetBlockingHook(FARPROC lpBlockFunc);
75int d_WSACancelBlockingCall(void);
76HANDLE d_WSAAsyncGetServByName(HWND hWnd, u_int wMsg,
77 const char *name,
78 const char *proto,
79 char *buf, int buflen);
80HANDLE d_WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port,
81 const char *proto, char *buf,
82 int buflen);
83HANDLE d_WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg,
84 const char *name, char *buf,
85 int buflen);
86HANDLE d_WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg,
87 int number, char *buf,
88 int buflen);
89HANDLE d_WSAAsyncGetHostByName(HWND hWnd, u_int wMsg,
90 const char *name, char *buf,
91 int buflen);
92HANDLE d_WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg,
93 const char *addr, int len, int type,
94 char *buf, int buflen);
95int d_WSACancelAsyncRequest(HANDLE hAsyncTaskHandle);
96int d_WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg,
97 long lEvent);
98
99
100
101
102
103#endif
Note: See TracBrowser for help on using the repository browser.