ioloop.h revision 6246b93fb37890dcb2f4df9896438f3f376ab284
#ifndef __IOLOOP_H
#define __IOLOOP_H
#include <time.h>
struct io;
struct timeout;
struct ioloop;
enum io_condition {
IO_READ = 0x01,
IO_WRITE = 0x02,
/* internal */
IO_NOTIFY = 0x04,
};
typedef void io_callback_t(void *context);
typedef void timeout_callback_t(void *context);
/* Time when the I/O loop started calling handlers.
Can be used instead of time(NULL). */
extern time_t ioloop_time;
extern struct timeval ioloop_timeval;
extern struct timezone ioloop_timezone;
/* I/O listeners - you can create different handlers for IO_READ and IO_WRITE,
but make sure you don't create multiple handlers of same type, it's not
checked and removing one will stop the other from working as well.
*/
void *context);
/* Timeout handlers */
void *context);
/* call these if you wish to run the iteration only once */
#endif