Watt-32 tcp/ip  2.2 dev-rel.10
winsock.h
1 #ifndef _WATT32_FAKE_WINSOCK_H
2 #define _WATT32_FAKE_WINSOCK_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_WINSOCK2_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 W32_FUNC int __stdcall WSACleanup (void);
39 
40 #ifndef FD_SETSIZE
41 #define FD_SETSIZE 64
42 #endif
43 
44 /*
45  * Needed if user compiled with the normal <winsock*.h> and just relinked
46  * with Watt-32 (import) library.
47  */
48 typedef struct winsock_fd_set {
49  unsigned int fd_count; /* how many are SET? */
50  int fd_array [FD_SETSIZE]; /* an array of sockets */
52 
53 W32_FUNC int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd);
54 
55 #endif /* _WATT32_FAKE_WINSOCK2_H */
56 #endif
57