diff options
Diffstat (limited to 'src/iobuffer.h')
| -rw-r--r-- | src/iobuffer.h | 23 |
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 @@ | |||
| 1 | #ifndef IOBUFFER_H | ||
| 2 | #define IOBUFFER_H | ||
| 3 | |||
| 4 | #include "common.h" | ||
| 5 | |||
| 6 | #define EVENT_SIZE sizeof(struct input_event) | ||
| 7 | #define DIM_EVENTS 64 | ||
| 8 | #define DIM_BUFFER (DIM_EVENTS * EVENT_SIZE) | ||
| 9 | |||
| 10 | //////////////////////////////////////////////////////// | ||
| 11 | |||
| 12 | struct IOBuffer { | ||
| 13 | char begin[DIM_BUFFER], *at, *top, *end; | ||
| 14 | }; | ||
| 15 | |||
| 16 | //////////////////////////////////////////////////////// | ||
| 17 | |||
| 18 | void init_iobuf(struct IOBuffer *buf); | ||
| 19 | const struct input_event* get_iobuf_event(struct IOBuffer *buf, int fd); | ||
| 20 | |||
| 21 | //////////////////////////////////////////////////////// | ||
| 22 | |||
| 23 | #endif | ||
