logging: introduce library-internal logging categories
[osmocom-bb.git] / include / osmocom / core / select.h
1 #ifndef _BSC_SELECT_H
2 #define _BSC_SELECT_H
3
4 #include <osmocom/core/linuxlist.h>
5
6 #define BSC_FD_READ     0x0001
7 #define BSC_FD_WRITE    0x0002
8 #define BSC_FD_EXCEPT   0x0004
9
10 struct osmo_fd {
11         struct llist_head list;
12         int fd;
13         unsigned int when;
14         int (*cb)(struct osmo_fd *fd, unsigned int what);
15         void *data;
16         unsigned int priv_nr;
17 };
18
19 int osmo_fd_register(struct osmo_fd *fd);
20 void osmo_fd_unregister(struct osmo_fd *fd);
21 int osmo_select_main(int polling);
22 #endif /* _BSC_SELECT_H */