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)
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 @@
26 * 26 *
27 ****************************************************************************/ 27 ****************************************************************************/
28 28
29#include <mtdev-mapping.h> 29#define MTDEV_NO_LEGACY_API
30#include <mtdev.h>
30#include <stdio.h> 31#include <stdio.h>
31 32
32#define BIT_DEF(name) \ 33#define MT_ABS_SIZE 11
33 printf("#define MTDEV_"#name"\t%d\n", \ 34#define MT_SLOT_ABS_EVENTS { \
34 cabs2mt[ABS_MT_##name] - 1) 35 ABS_MT_TOUCH_MAJOR, \
36 ABS_MT_TOUCH_MINOR, \
37 ABS_MT_WIDTH_MAJOR, \
38 ABS_MT_WIDTH_MINOR, \
39 ABS_MT_ORIENTATION, \
40 ABS_MT_POSITION_X, \
41 ABS_MT_POSITION_Y, \
42 ABS_MT_TOOL_TYPE, \
43 ABS_MT_BLOB_ID, \
44 ABS_MT_TRACKING_ID, \
45 ABS_MT_PRESSURE, \
46}
35 47
36static unsigned int cabs2mt[ABS_CNT]; 48static unsigned int cabs2mt[ABS_CNT];
37static unsigned int cmt2abs[MT_ABS_SIZE]; 49static unsigned int cmt2abs[MT_ABS_SIZE];
@@ -63,17 +75,5 @@ int main(int argc, char *argv[])
63 for (i = 0; i < MT_ABS_SIZE; i++) 75 for (i = 0; i < MT_ABS_SIZE; i++)
64 printf(" 0x%04x,%s", cmt2abs[i], newln(i, MT_ABS_SIZE)); 76 printf(" 0x%04x,%s", cmt2abs[i], newln(i, MT_ABS_SIZE));
65 printf("};\n\n"); 77 printf("};\n\n");
66 BIT_DEF(TOUCH_MAJOR);
67 BIT_DEF(TOUCH_MINOR);
68 BIT_DEF(WIDTH_MAJOR);
69 BIT_DEF(WIDTH_MINOR);
70 BIT_DEF(ORIENTATION);
71 BIT_DEF(POSITION_X);
72 BIT_DEF(POSITION_Y);
73 BIT_DEF(TOOL_TYPE);
74 BIT_DEF(BLOB_ID);
75 BIT_DEF(TRACKING_ID);
76 BIT_DEF(PRESSURE);
77 printf("\n");
78 return 0; 78 return 0;
79} 79}