X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Fmtio.h;h=ffb57da0c253587166faa8c647ca4059015604e2;hb=56e1ccba9f8df6e59711d067c6fcb05b74fc35ca;hp=0ae9780d0300d55e7d2d1eb43305dc2efd55d039;hpb=e1cdf02ebc900813c2395c58ee528440a9699e18;p=ashd.git diff --git a/lib/mtio.h b/lib/mtio.h index 0ae9780..ffb57da 100644 --- a/lib/mtio.h +++ b/lib/mtio.h @@ -1,11 +1,28 @@ #ifndef _LIB_MTIO_H #define _LIB_MTIO_H +#include + #define EV_READ 1 #define EV_WRITE 2 +struct stdiofd { + int fd; + int sock; + int timeout; + int rights, sendrights; +}; + +struct selected { + int fd, ev; +}; + +struct selected mblock(time_t to, int n, struct selected *spec); int block(int fd, int ev, time_t to); -void ioloop(void); -FILE *mtstdopen(int fd, int issock, int timeout, char *mode); +int ioloop(void); +void exitioloop(int status); +FILE *mtstdopen(int fd, int issock, int timeout, char *mode, struct stdiofd **infop); +struct bufio *mtbioopen(int fd, int issock, int timeout, char *mode, struct stdiofd **infop); +void mtiopipe(FILE **read, FILE **write); #endif