Watt-32 tcp/ip  2.2 dev-rel.10
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 typedef struct _SOCKET_ADDRESS {
23  struct sockaddr lpSockaddr;
24  int iSockaddrLength;
26 
27 #define WSADESCRIPTION_LEN 256
28 #define WSASYS_STATUS_LEN 128
29 
30 typedef struct WSAData {
31  unsigned short wVersion;
32  unsigned short wHighVersion;
33  char szDescription[WSADESCRIPTION_LEN+1];
34  char szSystemStatus[WSASYS_STATUS_LEN+1];
35  unsigned short iMaxSockets;
36  unsigned short iMaxUdpDg;
37  char *lpVendorInfo;
38  } WSADATA, *LPWSADATA;
39 
40 W32_FUNC int __stdcall WSAStartup (unsigned short wVersionRequired,
41  WSADATA *WSAData);
42 
43 W32_FUNC int __stdcall WSACleanup (void);
44 
45 #ifndef FD_SETSIZE
46 #define FD_SETSIZE 64
47 #endif
48 
49 /*
50  * Needed if user compiled with the normal <winsock*.h> and just relinked
51  * with Watt-32 (import) library.
52  */
53 typedef struct winsock_fd_set {
54  unsigned int fd_count; /* how many are SET? */
55  int fd_array [FD_SETSIZE]; /* an array of sockets */
57 
58 W32_FUNC int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd);
59 
60 #endif /* _WATT32_FAKE_WINSOCK_H */
61 #endif /* _WATT32_FAKE_WINSOCK2_H */
62