added watt32 headers and brought the DOS version up to parity with UNIX
[oftp] / libs / watt32 / winsock2.h
1 #ifndef _WATT32_FAKE_WINSOCK2_H
2 #define _WATT32_FAKE_WINSOCK2_H
3
4 #ifndef __SYS_W32API_H
5 #include <sys/w32api.h>
6 #endif
7
8 #ifndef __SYS_SOCKET_H
9 #include <sys/socket.h>
10 #endif
11
12 #ifndef __SYS_WERRNO_H
13 #include <sys/werrno.h>
14 #endif
15
16 #if !defined(WIN32) && !defined(_WIN32)
17 #error This file is only for Watt-32 targeting Windows programs.
18 #endif
19
20 #if !defined(_WATT32_FAKE_WINSOCK_H)
21
22 #define WSADESCRIPTION_LEN  256
23 #define WSASYS_STATUS_LEN   128
24
25 typedef struct WSAData {
26         unsigned short wVersion;
27         unsigned short wHighVersion;
28         char           szDescription[WSADESCRIPTION_LEN+1];
29         char           szSystemStatus[WSASYS_STATUS_LEN+1];
30         unsigned short iMaxSockets;
31         unsigned short iMaxUdpDg;
32         char          *lpVendorInfo;
33       } WSADATA, *LPWSADATA;
34
35 W32_FUNC int __stdcall WSAStartup (unsigned short wVersionRequired,
36                                    WSADATA *WSAData);
37
38
39 #ifndef FD_SETSIZE
40 #define FD_SETSIZE  64
41 #endif
42
43 /*
44  * Needed if user compiled with the normal <winsock*.h> and just relinked
45  * with Watt-32 (import) library.
46  */
47 typedef struct winsock_fd_set {
48         unsigned int fd_count;               /* how many are SET? */
49         int          fd_array [FD_SETSIZE];  /* an array of sockets */
50       } winsock_fd_set;
51
52 W32_FUNC int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd);
53
54 #endif  /* _WATT32_FAKE_WINSOCK_H */
55 #endif  /* _WATT32_FAKE_WINSOCK2_H */
56