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.
14 * I/O abstraction interface (header)
21 #define IO_WANTWRITE 2
24 sets up epoll/kqueue descriptors and tries to allocate space for ioevlen
25 file descriptors. ioevlen is just the _initial_ size, not a limit. */
26 bool io_library_init PARAMS((unsigned int ioevlen));
28 /* shutdown and free all internal data structures */
29 void io_library_shutdown PARAMS((void));
31 /* add fd to internal set, enable readability check, set callback */
32 bool io_event_create PARAMS((int fd, short what, void (*cbfunc)(int, short)));
34 /* change callback function associated with fd */
35 bool io_event_setcb PARAMS((int fd, void (*cbfunc)(int, short)));
37 /* watch fd for event of type what */
38 bool io_event_add PARAMS((int fd, short what));
40 /* do not watch fd for event of type what */
41 bool io_event_del PARAMS((int fd, short what));
43 /* remove fd from watchlist, close() fd. */
44 bool io_close PARAMS((int fd));
47 bool io_setnonblock PARAMS((int fd));
50 bool io_setcloexec PARAMS((int fd));
52 /* watch fds for activity */
53 int io_dispatch PARAMS((struct timeval *tv));
55 #endif /* io_H_included */