blob: 2822f7187c84d7c5943fc059ba0310aaafb86e6a [file] [log] [blame]
#ifndef IOLOOPER_H
#define IOLOOPER_H
#include <stdint.h>
/* An IOLooper is an abstraction for select() */
typedef struct IoLooper IoLooper;
IoLooper* iolooper_new(void);
void iolooper_free( IoLooper* iol );
void iolooper_reset( IoLooper* iol );
void iolooper_add_read( IoLooper* iol, int fd );
void iolooper_add_write( IoLooper* iol, int fd );
void iolooper_del_read( IoLooper* iol, int fd );
void iolooper_del_write( IoLooper* iol, int fd );
int iolooper_poll( IoLooper* iol );
int iolooper_wait( IoLooper* iol, int64_t duration );
int iolooper_is_read( IoLooper* iol, int fd );
int iolooper_is_write( IoLooper* iol, int fd );
/* Returns 1 if this IoLooper has one or more file descriptor to interact with */
int iolooper_has_operations( IoLooper* iol );
#endif /* IOLOOPER_H */