aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/event_loop.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-13 01:50:24 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-13 01:50:24 +0200
commit5b58c9fd2880911aa926259d97a396e97f3d4313 (patch)
treefefbc7a72447f2f12adbe0e16d6f597cf05e3fdf /src/event_loop.h
parentuse signalfd to stop on SIGTERM (diff)
downloadcimple-5b58c9fd2880911aa926259d97a396e97f3d4313.tar.gz
cimple-5b58c9fd2880911aa926259d97a396e97f3d4313.zip
event_loop: hide the API details
Diffstat (limited to 'src/event_loop.h')
-rw-r--r--src/event_loop.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/event_loop.h b/src/event_loop.h
index eb5ff05..5273cc6 100644
--- a/src/event_loop.h
+++ b/src/event_loop.h
@@ -9,7 +9,6 @@
#define __EVENT_LOOP_H__
#include <poll.h>
-#include <sys/queue.h>
struct event_loop;
@@ -20,17 +19,8 @@ int event_loop_run(struct event_loop *);
#define EVENT_LOOP_REMOVE 1
-typedef int (*event_loop_handler)(struct event_loop *, int fd, short revents, void *arg);
+typedef int (*event_handler)(struct event_loop *, int fd, short revents, void *arg);
-struct event_fd {
- int fd;
- short events;
- event_loop_handler handler;
- void *arg;
-
- SIMPLEQ_ENTRY(event_fd) entries;
-};
-
-int event_loop_add(struct event_loop *, const struct event_fd *);
+int event_loop_add(struct event_loop *, int fd, short events, event_handler, void *arg);
#endif