aboutsummaryrefslogtreecommitdiff
path: root/src/pevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pevent.h')
-rw-r--r--src/pevent.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pevent.h b/src/pevent.h
index 0f387aa..1c50073 100644
--- a/src/pevent.h
+++ b/src/pevent.h
@@ -34,6 +34,7 @@
#ifndef POTD_EVENT_H
#define POTD_EVENT_H 1
+#include <stdio.h>
#include <sys/epoll.h>
#include "socket.h"
@@ -52,6 +53,8 @@ typedef struct event_buf {
char buf[BUFSIZ];
size_t buf_used;
+
+ void *buf_user_data;
} event_buf;
typedef struct event_ctx {
@@ -81,9 +84,9 @@ int event_setup(event_ctx *ctx);
int event_validate_ctx(event_ctx *ctx);
-int event_add_sock(event_ctx *ctx, psocket *sock);
+int event_add_sock(event_ctx *ctx, psocket *sock, void *buf_user_data);
-int event_add_fd(event_ctx *ctx, int fd);
+int event_add_fd(event_ctx *ctx, int fd, void *buf_user_data);
int event_loop(event_ctx *ctx, on_event_cb on_event, void *user_data);