aboutsummaryrefslogtreecommitdiff
path: root/fdm.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-04 18:48:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-04 18:48:15 +0000
commita3c18e72f5804051c5111fea5f4fca488fa088ca (patch)
tree33885042c97616254c7971749a4e4d49afa33af8 /fdm.h
parentdoc: document how to do block selections (diff)
fdm: add support for hooks
Hooks are functions executed just before going into a poll(). Or just after executing all FD handlers, if you like.
Diffstat (limited to 'fdm.h')
-rw-r--r--fdm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fdm.h b/fdm.h
index 62d73ded..62f7616f 100644
--- a/fdm.h
+++ b/fdm.h
@@ -5,6 +5,7 @@
struct fdm;
typedef bool (*fdm_handler_t)(struct fdm *fdm, int fd, int events, void *data);
+typedef void (*fdm_hook_t)(struct fdm *fdm, void *data);
struct fdm *fdm_init(void);
void fdm_destroy(struct fdm *fdm);
@@ -16,4 +17,7 @@ bool fdm_del_no_close(struct fdm *fdm, int fd);
bool fdm_event_add(struct fdm *fdm, int fd, int events);
bool fdm_event_del(struct fdm *fdm, int fd, int events);
+bool fdm_hook_add(struct fdm *fdm, fdm_hook_t hook, void *data);
+bool fdm_hook_del(struct fdm *fdm, fdm_hook_t hook);
+
bool fdm_poll(struct fdm *fdm);