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.1 2005/07/07 18:38:35 fw Exp $
13 #ifndef io_H_inclucded
20 #define IO_WANTWRITE 2
22 /* init library. sets up epoll/kqueue descriptors and tries to allocate space for ioevlen file descriptors.
23 ioevlen is just the _initial_ size, not a limit. */
24 bool io_library_init PARAMS((unsigned int ioevlen));
26 /* shutdown and free all internal data structures */
27 bool io_library_shutdown PARAMS((void));
29 /* add fd to internal set, enable readability check, set callback */
30 bool io_event_create PARAMS((int fd, short what, void (*cbfunc)(int, short)));
32 /* change callback function associated with fd */
33 bool io_event_setcb PARAMS((int fd, void (*cbfunc)(int, short)));
35 /* watch fd for event of type what */
36 bool io_event_add PARAMS((int fd, short what));
38 /* do not watch fd for event of type what */
39 bool io_event_del PARAMS((int fd, short what));
41 /* remove fd from watchlist, close() fd. */
42 bool io_close PARAMS((int fd));
45 bool io_setnonblock PARAMS((int fd));
47 /* watch fds for activity */
48 int io_dispatch PARAMS((struct timeval *tv));
50 #endif /* io_H_included */