blob: ed7f6bbdb9994a4c673a4e3bf71bb552a9f45d69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#ifndef _WAITER_H
#define _WAITER_H
#include <poll.h>
struct waiter;
struct waitset;
enum events {
WAIT_IN = POLLIN,
WAIT_OUT = POLLOUT,
};
typedef int (*waiter_cb)(void *);
struct waitset *waitset_create(void *ctx);
void waitset_destroy(struct waitset *waitset);
struct waiter *waiter_register(struct waitset *waitset, int fd, int events,
waiter_cb callback, void *arg);
void waiter_remove(struct waiter *waiter);
int waiter_poll(struct waitset *waitset);
#endif /* _WAITER_H */
|