aboutsummaryrefslogtreecommitdiff
path: root/hid_linux.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-10-22 18:49:16 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2004-10-22 18:49:16 +0000
commit9554c20806f8da1482790543f2ec5a3c91b363d0 (patch)
tree87c1653591f47f75da9e467f0d2a4fae1bb65c94 /hid_linux.c
parentf59333ff17f17d8fa9e983ccee47f43cd77a3040 (diff)
more progress generalizing for cross-platformness; Darwin stuff compiles and the object loads, but it doesn't do anything yet
svn path=/trunk/externals/hcs/hid/; revision=2141
Diffstat (limited to 'hid_linux.c')
-rw-r--r--hid_linux.c27
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__ */