summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/evemu.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/include/evemu.h b/include/evemu.h
index 70a5bd5..698a539 100644
--- a/include/evemu.h
+++ b/include/evemu.h
@@ -26,28 +26,22 @@
26 * 26 *
27 ****************************************************************************/ 27 ****************************************************************************/
28 28
29#ifndef _EVPLAY_H 29#ifndef _EVEMU_H
30#define _EVPLAY_H 30#define _EVEMU_H
31 31
32#include <linux/uinput.h>
33#include <stdio.h> 32#include <stdio.h>
33#include <errno.h>
34#include <linux/input.h>
34 35
35#define EVPLAY_NBITS KEY_CNT 36#define EVEMU_VERSION_MAJOR 1
36#define EVPLAY_NBYTES ((EVPLAY_NBITS + 7) / 8) 37#define EVEMU_VERSION_MINOR 1
37 38
38struct evemu_device { 39struct evemu_device *evemu_new(const char *name);
39 char name[UINPUT_MAX_NAME_SIZE]; 40void evemu_delete(struct evemu_device *dev);
40 struct input_id id;
41 unsigned char mask[EV_CNT][EVPLAY_NBYTES];
42 int bytes[EV_CNT];
43 struct input_absinfo abs[ABS_CNT];
44};
45 41
46static inline int evemu_has(const struct evemu_device *dev, 42const char *evemu_get_name(const struct evemu_device *dev);
47 int type, int code) 43
48{ 44int evemu_has(const struct evemu_device *dev, int type, int code);
49 return (dev->mask[type][code >> 3] >> (code & 7)) & 1;
50}
51 45
52int evemu_extract(struct evemu_device *dev, int fd); 46int evemu_extract(struct evemu_device *dev, int fd);
53int evemu_write(const struct evemu_device *dev, FILE *fp); 47int evemu_write(const struct evemu_device *dev, FILE *fp);