summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-12 11:43:14 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-12 11:43:14 +0200
commit6c0a0e645d4663fdd15de41d3e4dc3f45d6ce708 (patch)
tree06ed565351f628b8e62c90b000493bd9c583aca2 /include
parent4a29f348135671ba59107a1659fab6c8c9362f58 (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.h4
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);