diff options
author | Guangxiong Lin <[email protected]> | 2022-12-16 13:53:35 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-12-16 13:53:35 +0800 |
commit | 7369505397cdfddf0883e2c24e1652df8bd488fe (patch) | |
tree | e961bd1bba0276e2c5f523bf12663b34983c9e51 /evloop.h | |
parent | 49839c88a98d3798f7b18c58f54f26f36cacff38 (diff) | |
download | tinyserver-7369505397cdfddf0883e2c24e1652df8bd488fe.tar.gz tinyserver-7369505397cdfddf0883e2c24e1652df8bd488fe.tar.bz2 tinyserver-7369505397cdfddf0883e2c24e1652df8bd488fe.zip |
Refactor file structure
Diffstat (limited to 'evloop.h')
-rw-r--r-- | evloop.h | 32 |
1 files changed, 0 insertions, 32 deletions
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 |