diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-08-12 11:43:14 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-08-12 11:43:14 +0200 |
commit | 6c0a0e645d4663fdd15de41d3e4dc3f45d6ce708 (patch) | |
tree | 06ed565351f628b8e62c90b000493bd9c583aca2 /include | |
parent | 4a29f348135671ba59107a1659fab6c8c9362f58 (diff) |
add osmo_fd_setup() convenience function to fill-in osmo_fd
This basically follows the concept of osmo_timer_setup() and allows
the caller to fill-in all configurable fields of osmo_fd in one
line of code, rather than open-coding it in 5 lines everywhere.
Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/core/select.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index 2abda2dc..b6fed3c7 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -36,6 +36,10 @@ struct osmo_fd { unsigned int priv_nr; }; +void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, + int (*cb)(struct osmo_fd *fd, unsigned int what), + void *data, unsigned int priv_nr); + bool osmo_fd_is_registered(struct osmo_fd *fd); int osmo_fd_register(struct osmo_fd *fd); void osmo_fd_unregister(struct osmo_fd *fd); |