diff options
-rw-r--r-- | evtest.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -40,6 +40,16 @@ #include <stdlib.h> #include <dirent.h> +#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) + +#define DEV_INPUT_EVENT "/dev/input" +#define EVENT_DEV_NAME "event" + #ifndef EV_SYN #define EV_SYN 0 #endif @@ -413,16 +423,6 @@ char **names[EV_MAX + 1] = { [EV_SND] = sounds, [EV_REP] = repeats, }; -#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) - -#define DEV_INPUT_EVENT "/dev/input" -#define EVENT_DEV_NAME "event" - /* filter for the AutoDevProbe scandir on /dev/input */ static int EventDevOnly(const struct dirent *dir) { return strncmp(EVENT_DEV_NAME, dir->d_name, 5) == 0; |