diff options
Diffstat (limited to 'iolooper.h')
-rw-r--r-- | iolooper.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/iolooper.h b/iolooper.h new file mode 100644 index 0000000..ead3583 --- /dev/null +++ b/iolooper.h @@ -0,0 +1,25 @@ +#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 ); + +#endif /* IOLOOPER_H */ |