aboutsummaryrefslogtreecommitdiff
path: root/fdm.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-10-27 10:46:18 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-10-27 10:46:18 +0000
commit5fefb950b3a1de2c8c8e2cbfecf4ed3790ecffef (patch)
tree41a087ea5bd2d4e6714029466e8b24b29bc0ae7a /fdm.h
parentPKGBUILD: fix breakage after pacman 5.2 upgrade (diff)
fdm: use the FDM's poll loop
Diffstat (limited to 'fdm.h')
-rw-r--r--fdm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fdm.h b/fdm.h
new file mode 100644
index 00000000..cd0fee2a
--- /dev/null
+++ b/fdm.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <stdbool.h>
+
+struct fdm;
+
+typedef bool (*fdm_handler_t)(struct fdm *fdm, int fd, int events, void *data);
+
+struct fdm *fdm_init(void);
+void fdm_destroy(struct fdm *fdm);
+
+bool fdm_add(struct fdm *fdm, int fd, int events, fdm_handler_t handler, void *data);
+bool fdm_del(struct fdm *fdm, int fd);
+
+bool fdm_poll(struct fdm *fdm);