summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-12-22 18:29:00 +0100
committerHenrik Rydberg <rydberg@euromail.se>2010-12-22 18:29:00 +0100
commit56a77e68fb91eef928d8a95c50ae14508e37ae0f (patch)
tree51af9bb9dd508bca58e8b9416479e79f8bb7ee10 /test
parent0e2ab3b5940e70493aaabdfe5e8da1c75db4db72 (diff)
downloadmtdev-git-56a77e68fb91eef928d8a95c50ae14508e37ae0f.tar.gz
Introduce a stable ABI
The current mtdev is not ABI stable, and the upcoming additions to the kernel api will break ABI. This patch starts the process of keeping binary compatibility with old programs, by moving the abi-specific parts under a special flag, MTDEV_NO_LEGACY_API, and makes sure the internal parts compiles with MTDEV_NO_LEGACY_API set. This way, older programs will still work, old programs will still compile, and new programs will be able to use the additions. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'test')
-rw-r--r--test/mtdev-mapgen.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/mtdev-mapgen.c b/test/mtdev-mapgen.c
index 8f70998..dc1ba91 100644
--- a/test/mtdev-mapgen.c
+++ b/test/mtdev-mapgen.c
@@ -26,12 +26,24 @@
*
****************************************************************************/
-#include <mtdev-mapping.h>
+#define MTDEV_NO_LEGACY_API
+#include <mtdev.h>
#include <stdio.h>
-#define BIT_DEF(name) \
- printf("#define MTDEV_"#name"\t%d\n", \
- cabs2mt[ABS_MT_##name] - 1)
+#define MT_ABS_SIZE 11
+#define MT_SLOT_ABS_EVENTS { \
+ ABS_MT_TOUCH_MAJOR, \
+ ABS_MT_TOUCH_MINOR, \
+ ABS_MT_WIDTH_MAJOR, \
+ ABS_MT_WIDTH_MINOR, \
+ ABS_MT_ORIENTATION, \
+ ABS_MT_POSITION_X, \
+ ABS_MT_POSITION_Y, \
+ ABS_MT_TOOL_TYPE, \
+ ABS_MT_BLOB_ID, \
+ ABS_MT_TRACKING_ID, \
+ ABS_MT_PRESSURE, \
+}
static unsigned int cabs2mt[ABS_CNT];
static unsigned int cmt2abs[MT_ABS_SIZE];
@@ -63,17 +75,5 @@ int main(int argc, char *argv[])
for (i = 0; i < MT_ABS_SIZE; i++)
printf(" 0x%04x,%s", cmt2abs[i], newln(i, MT_ABS_SIZE));
printf("};\n\n");
- BIT_DEF(TOUCH_MAJOR);
- BIT_DEF(TOUCH_MINOR);
- BIT_DEF(WIDTH_MAJOR);
- BIT_DEF(WIDTH_MINOR);
- BIT_DEF(ORIENTATION);
- BIT_DEF(POSITION_X);
- BIT_DEF(POSITION_Y);
- BIT_DEF(TOOL_TYPE);
- BIT_DEF(BLOB_ID);
- BIT_DEF(TRACKING_ID);
- BIT_DEF(PRESSURE);
- printf("\n");
return 0;
}