From 7369505397cdfddf0883e2c24e1652df8bd488fe Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 16 Dec 2022 13:53:35 +0800 Subject: Refactor file structure --- evloop.h | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 evloop.h (limited to 'evloop.h') diff --git a/evloop.h b/evloop.h deleted file mode 100644 index f0d4f72..0000000 --- a/evloop.h +++ /dev/null @@ -1,32 +0,0 @@ -#include "tsocket.h" - -#ifndef __EVLOOP_H -#define __EVLOOP_H - -#define EVENT_LOOP_MAX_EVENTS 1024 - -struct evloop; -typedef struct evloop evloop_t; - -typedef void (*evloop_process_func_t)(void *data); -typedef void (*evloop_destroy_func_t)(void *data); - -struct event { - int fd; - void *data; - evloop_destroy_func_t destroy; - evloop_process_func_t process; -}; -typedef struct event event_t; - -evloop_t *evloop_create(); -int evloop_wait(evloop_t *el, int timeout); -int evloop_add(evloop_t *el, event_t *ev, int flag); -int evloop_remove(evloop_t *el, event_t *ev); -event_t *evloop_get(evloop_t *el, int index); -void evloop_loop(evloop_t *el); -event_t *event_create(void *data, int fd, - evloop_process_func_t process, - evloop_destroy_func_t destroy); - -#endif -- cgit v1.2.3