| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 * |
21 * |
| 22 */ |
22 */ |
| 23 #ifndef _LIBC_INTERFACE_H_ |
23 #ifndef _LIBC_INTERFACE_H_ |
| 24 #define _LIBC_INTERFACE_H_ |
24 #define _LIBC_INTERFACE_H_ |
| 25 #include <winsock.h> |
25 #include <winsock2.h> |
| |
26 #include <ws2tcpip.h> |
| 26 #include <io.h> |
27 #include <io.h> |
| 27 #include <errno.h> |
28 #include <errno.h> |
| 28 #include "libc_internal.h" |
29 #include "libc_internal.h" |
| 29 |
30 |
| 30 /* sys/socket.h */ |
31 /* sys/socket.h */ |
| 37 wgaim_connect( socket, addr, length ) |
38 wgaim_connect( socket, addr, length ) |
| 38 |
39 |
| 39 extern int wgaim_getsockopt(int socket, int level, int optname, void *optval, unsigned int *optlenptr); |
40 extern int wgaim_getsockopt(int socket, int level, int optname, void *optval, unsigned int *optlenptr); |
| 40 #define getsockopt( args... ) \ |
41 #define getsockopt( args... ) \ |
| 41 wgaim_getsockopt( args ) |
42 wgaim_getsockopt( args ) |
| |
43 |
| |
44 extern int wgaim_setsockopt(int socket, int level, int optname, void *optval, unsigned int *optlenptr); |
| |
45 #define setsockopt( args... ) \ |
| |
46 wgaim_setsockopt( args ) |
| |
47 |
| |
48 extern int wgaim_getsockname (int socket, struct sockaddr *addr, socklen_t *lenptr); |
| |
49 #define getsockname( socket, addr, lenptr ) \ |
| |
50 wgaim_getsockname( socket, addr, lenptr ) |
| |
51 |
| |
52 extern int wgaim_bind(int socket, struct sockaddr *addr, socklen_t length); |
| |
53 #define bind( socket, addr, length ) \ |
| |
54 wgaim_bind( socket, addr, length ) |
| |
55 |
| |
56 extern int wgaim_listen(int socket, unsigned int n); |
| |
57 #define listen( socket, n ) \ |
| |
58 wgaim_listen( socket, n ) |
| 42 |
59 |
| 43 /* sys/ioctl.h */ |
60 /* sys/ioctl.h */ |
| 44 extern int wgaim_ioctl(int fd, int command, void* opt); |
61 extern int wgaim_ioctl(int fd, int command, void* opt); |
| 45 #define ioctl( fd, command, val ) \ |
62 #define ioctl( fd, command, val ) \ |
| 46 wgaim_ioctl( fd, command, val ) |
63 wgaim_ioctl( fd, command, val ) |
| 92 #define close( fd ) \ |
109 #define close( fd ) \ |
| 93 wgaim_close( fd ) |
110 wgaim_close( fd ) |
| 94 |
111 |
| 95 #define sleep(x) Sleep((x)*1000) |
112 #define sleep(x) Sleep((x)*1000) |
| 96 |
113 |
| |
114 extern int wgaim_gethostname(char *name, size_t size); |
| |
115 #define gethostname( name, size ) \ |
| |
116 wgaim_gethostname( name, size ) |
| |
117 |
| 97 /* sys/time.h */ |
118 /* sys/time.h */ |
| 98 extern int wgaim_gettimeofday(struct timeval *p, struct timezone *z); |
119 extern int wgaim_gettimeofday(struct timeval *p, struct timezone *z); |
| 99 #define gettimeofday( timeval, timezone ) \ |
120 #define gettimeofday( timeval, timezone ) \ |
| 100 wgaim_gettimeofday( timeval, timezone ) |
121 wgaim_gettimeofday( timeval, timezone ) |
| 101 |
122 |