Anope IRC Services  Version 2.0
socket.h
Go to the documentation of this file.
1  /* POSIX emulation layer for Windows.
2  *
3  * Copyright (C) 2008-2014 Anope Team <team@anope.org>
4  *
5  * Please read COPYING and README for further details.
6  */
7 
8 #define read read_not_used
9 #define write write_not_used
10 #include <io.h>
11 #undef read
12 #undef write
13 
14 #define F_GETFL 0
15 #define F_SETFL 1
16 
17 #define O_NONBLOCK 1
18 
19 extern CoreExport int read(int fd, char *buf, size_t count);
20 extern CoreExport int write(int fd, const char *buf, size_t count);
21 extern CoreExport int windows_close(int fd);
22 extern CoreExport int windows_accept(int fd, struct sockaddr *addr, int *addrlen);
23 extern CoreExport int windows_inet_pton(int af, const char *src, void *dst);
24 extern CoreExport const char *windows_inet_ntop(int af, const void *src, char *dst, size_t size);
25 extern CoreExport int fcntl(int fd, int cmd, int arg);
26 
27 #ifndef WIN32_NO_OVERRIDE
28 # define accept windows_accept
29 # define inet_pton windows_inet_pton
30 # define inet_ntop windows_inet_ntop
31 #endif
CoreExport int windows_close(int fd)
Definition: socket.cpp:34
CoreExport int fcntl(int fd, int cmd, int arg)
Definition: socket.cpp:131
CoreExport int windows_inet_pton(int af, const char *src, void *dst)
Definition: socket.cpp:56
#define write
Definition: socket.h:9
#define read
Definition: socket.h:8
#define CoreExport
Definition: services.h:62
CoreExport int windows_accept(int fd, struct sockaddr *addr, int *addrlen)
Definition: socket.cpp:42
CoreExport const char * windows_inet_ntop(int af, const void *src, char *dst, size_t size)
Definition: socket.cpp:99