aboutsummaryrefslogtreecommitdiff
path: root/eventloop.h
diff options
context:
space:
mode:
Diffstat (limited to 'eventloop.h')
-rw-r--r--eventloop.h31
1 files changed, 0 insertions, 31 deletions
diff --git a/eventloop.h b/eventloop.h
deleted file mode 100644
index 9aafb68..0000000
--- a/eventloop.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <sys/epoll.h>
-
-#include "tsocket.h"
-
-#ifndef __EVENT_LOOP_H
-#define __EVENT_LOOP_H
-
-#define EVENT_LOOP_MAX_EVENTS 1024
-
-struct eventLoop {
- int epollfd;
- struct epoll_event events[EVENT_LOOP_MAX_EVENTS];
- int size;
-};
-
-struct event {
- int fd;
- void *data;
- int (*handle)(void *data);
- void (*delete)(void *data);
-};
-
-struct eventLoop *eventLoopNew();
-int eventLoopWait(struct eventLoop *el, int timeout);
-int eventLoopAdd(struct eventLoop *el, struct event *ev, int flag);
-int eventLoopDel(struct eventLoop *el, struct event *ev);
-struct event *eventLoopGet(struct eventLoop *el, int index);
-void eventLoopLoop(struct eventLoop *el);
-struct event *eventNew(void *data, int fd, void (*handle), void (*delete));
-
-#endif