diff options
Diffstat (limited to 'fdwatcher.h')
| -rw-r--r-- | fdwatcher.h | 18 |
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 *); |
