Commit | Line | Data |
---|---|---|
83723896 FT |
1 | #ifndef _LIB_MTIO_H |
2 | #define _LIB_MTIO_H | |
3 | ||
8774c31b FT |
4 | #include <stdio.h> |
5 | ||
83723896 FT |
6 | #define EV_READ 1 |
7 | #define EV_WRITE 2 | |
8 | ||
b71ad67f FT |
9 | struct stdiofd { |
10 | int fd; | |
11 | int sock; | |
12 | int timeout; | |
927cffe0 | 13 | int rights, sendrights; |
b71ad67f FT |
14 | }; |
15 | ||
205ee933 FT |
16 | struct selected { |
17 | int fd, ev; | |
18 | }; | |
19 | ||
20 | struct selected mblock(time_t to, int n, struct selected *spec); | |
83723896 | 21 | int block(int fd, int ev, time_t to); |
9d32586e FT |
22 | int ioloop(void); |
23 | void exitioloop(int status); | |
b71ad67f | 24 | FILE *mtstdopen(int fd, int issock, int timeout, char *mode, struct stdiofd **infop); |
122c2462 | 25 | struct bufio *mtbioopen(int fd, int issock, int timeout, char *mode, struct stdiofd **infop); |
d8aea4cf | 26 | void mtiopipe(FILE **read, FILE **write); |
83723896 FT |
27 | |
28 | #endif |