From 6c0a0e645d4663fdd15de41d3e4dc3f45d6ce708 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 12 Aug 2017 11:43:14 +0200 Subject: 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 --- include/osmocom/core/select.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/osmocom/core') 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); -- cgit v1.2.3