summary refs log tree commit diff
path: root/fdwatcher.h
diff options
context:
space:
mode:
authorrubin <rubinowyblask@meow.li>2026-05-22 13:42:51 +0200
committerrubin <rubinowyblask@meow.li>2026-05-22 13:42:51 +0200
commit77dc79afe5fd909fb1fe0a3cc668db2763b82fb8 (patch)
treefbca4863a432f33822f8ee97d9fe39c15462b401 /fdwatcher.h
import repository
Signed-off-by: rubinowy blask <rubinowyblask@encore.hosts.lumine>
Diffstat (limited to 'fdwatcher.h')
-rw-r--r--fdwatcher.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/fdwatcher.h b/fdwatcher.h
new file mode 100644
index 0000000..ce90198
--- /dev/null
+++ b/fdwatcher.h
@@ -0,0 +1,18 @@
+struct FDWatchHandle {
+	int maxWatchedFds;
+	int watchedFdCount;
+	struct pollfd *watchedFds;
+	void **arbitraryData;
+};
+
+enum FDWatch_EventType {
+	FDWATCH_EVENT_ERR = 0,
+	FDWATCH_EVENT_INP = 1,
+	FDWATCH_EVENT_OUT = 2,
+	FDWATCH_EVENT_HUP = 3
+};
+
+int fdwatcher_watch(struct FDWatchHandle *, int (*)(struct FDWatchHandle *, enum FDWatch_EventType, int, void *));
+int fdwatcher_initialise(struct FDWatchHandle *, int);
+int fdwatcher_remove(struct FDWatchHandle *, int);
+int fdwatcher_add(struct FDWatchHandle *, int, void *);