28 #include "ac-stdint.h"
33 # ifdef JABBERD2_EXPORTS
34 # define JABBERD2_API __declspec(dllexport)
36 # define JABBERD2_API __declspec(dllimport)
39 # define JABBERD2_API extern
44 # define MIO_MAXFD FD_SETSIZE
46 # define MIO_MAXFD 1024
58 #ifdef HAVE_SYS_SOCKET_H
59 # include <sys/socket.h>
66 #ifdef HAVE_SYS_IOCTL_H
67 # include <sys/ioctl.h>
70 #ifdef HAVE_SYS_FILIO_H
71 # include <sys/filio.h>
137 #define mio_free(m) (*m)->mio_free(m)
140 #define mio_listen(m, port, sourceip, app, arg) \
141 (*m)->mio_listen(m, port, sourceip, app, arg)
144 #define mio_connect(m, port, hostip, srcip, app, arg) \
145 (*m)->mio_connect(m, port, hostip, srcip, app, arg)
148 #define mio_register(m, fd, app, arg) \
149 (*m)->mio_register(m, fd, app, arg)
152 #define mio_app(m, fd, app, arg) (*m)->mio_app(m, fd, app, arg)
155 #define mio_close(m, fd) (*m)->mio_close(m, fd)
158 #define mio_write(m, fd) (*m)->mio_write(m, fd)
161 #define mio_read(m, fd) (*m)->mio_read(m, fd)
164 #define mio_run(m, timeout) (*m)->mio_run(m, timeout)
168 # define MIO_ERROR errno
169 # define MIO_SETERROR(e) (errno = e)
170 # define MIO_STRERROR(e) strerror(e)
171 # define MIO_WOULDBLOCK (errno == EWOULDBLOCK || errno == EINTR || errno == EAGAIN)
174 # define MIO_ERROR WSAGetLastError()
175 # define MIO_SETERROR(e) WSASetLastError(e)
176 # define MIO_STRERROR(e) mio_strerror(e)
177 # define MIO_WOULDBLOCK (WSAGetLastError() == WSAEWOULDBLOCK)
void(* mio_read)(struct mio_st **m, struct mio_fd_st *fd)
void(* mio_close)(struct mio_st **m, struct mio_fd_st *fd)
void(* mio_free)(struct mio_st **m)
JABBERD2_API mio_t mio_new(int maxfd)
create/free the mio subsytem
mio_action_t
these are the actions and a handler type assigned by the applicaiton using mio
struct mio_fd_st * mio_fd_t
int(* mio_handler_t)(struct mio_st **m, mio_action_t a, struct mio_fd_st *fd, void *data, void *arg)
void(* mio_app)(struct mio_st **m, struct mio_fd_st *fd, mio_handler_t app, void *arg)
void(* mio_run)(struct mio_st **m, int timeout)
void(* mio_write)(struct mio_st **m, struct mio_fd_st *fd)