diff options
Diffstat (limited to 'hid_linux.c')
-rw-r--r-- | hid_linux.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hid_linux.c b/hid_linux.c new file mode 100644 index 0000000..94a400b --- /dev/null +++ b/hid_linux.c @@ -0,0 +1,27 @@ +#ifdef __linux__ + +#include <linux/input.h> + + +#define DEBUG(x) +//#define DEBUG(x) x + + + + + +/*------------------------------------------------------------------------------ + * from evtest.c from the ff-utils package + */ + +#define BITS_PER_LONG (sizeof(long) * 8) +#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) +#define OFF(x) ((x)%BITS_PER_LONG) +#define BIT(x) (1UL<<OFF(x)) +#define LONG(x) ((x)/BITS_PER_LONG) +#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) + + + + +#endif /* #ifdef __linux__ */ |