From 5b58c9fd2880911aa926259d97a396e97f3d4313 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 13 Jun 2023 01:50:24 +0200 Subject: event_loop: hide the API details --- src/event_loop.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/event_loop.h') 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 -#include 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 -- cgit v1.2.3