aboutsummaryrefslogtreecommitdiffstats
path: root/src/iobuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/iobuffer.h')
-rw-r--r--src/iobuffer.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/iobuffer.h b/src/iobuffer.h
new file mode 100644
index 0000000..41c8d0d
--- /dev/null
+++ b/src/iobuffer.h
@@ -0,0 +1,23 @@
+#ifndef IOBUFFER_H
+#define IOBUFFER_H
+
+#include "common.h"
+
+#define EVENT_SIZE sizeof(struct input_event)
+#define DIM_EVENTS 64
+#define DIM_BUFFER (DIM_EVENTS * EVENT_SIZE)
+
+////////////////////////////////////////////////////////
+
+struct IOBuffer {
+ char begin[DIM_BUFFER], *at, *top, *end;
+};
+
+////////////////////////////////////////////////////////
+
+void init_iobuf(struct IOBuffer *buf);
+const struct input_event* get_iobuf_event(struct IOBuffer *buf, int fd);
+
+////////////////////////////////////////////////////////
+
+#endif