2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 * Please read the file COPYING, README and AUTHORS for more information.
8 * I/O abstraction interface header
10 * $Id: io.h,v 1.4 2006/12/25 22:53:52 alex Exp $
20 #define IO_WANTWRITE 2
23 sets up epoll/kqueue descriptors and tries to allocate space for ioevlen
24 file descriptors. ioevlen is just the _initial_ size, not a limit. */
25 bool io_library_init PARAMS((unsigned int ioevlen));
27 /* shutdown and free all internal data structures */
28 void io_library_shutdown PARAMS((void));
30 /* add fd to internal set, enable readability check, set callback */
31 bool io_event_create PARAMS((int fd, short what, void (*cbfunc)(int, short)));
33 /* change callback function associated with fd */
34 bool io_event_setcb PARAMS((int fd, void (*cbfunc)(int, short)));
36 /* watch fd for event of type what */
37 bool io_event_add PARAMS((int fd, short what));
39 /* do not watch fd for event of type what */
40 bool io_event_del PARAMS((int fd, short what));
42 /* remove fd from watchlist, close() fd. */
43 bool io_close PARAMS((int fd));
46 bool io_setnonblock PARAMS((int fd));
48 /* watch fds for activity */
49 int io_dispatch PARAMS((struct timeval *tv));
51 #endif /* io_H_included */