summaryrefslogtreecommitdiff
path: root/include/mtdev-plumbing.h
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 /include/mtdev-plumbing.h
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 'include/mtdev-plumbing.h')
-rw-r--r--include/mtdev-plumbing.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/mtdev-plumbing.h b/include/mtdev-plumbing.h
index cadc1f7..21ca708 100644
--- a/include/mtdev-plumbing.h
+++ b/include/mtdev-plumbing.h
@@ -36,6 +36,15 @@ extern "C" {
36#include <mtdev.h> 36#include <mtdev.h>
37 37
38/** 38/**
39 * mtdev_new - allocate a new mtdev
40 *
41 * Allocate a new mtdev.
42 *
43 * Returns zero in case of memory allocation failure.
44 */
45struct mtdev *mtdev_new(void);
46
47/**
39 * mtdev_init - initialize mtdev converter 48 * mtdev_init - initialize mtdev converter
40 * @dev: the mtdev to initialize 49 * @dev: the mtdev to initialize
41 * 50 *
@@ -46,6 +55,26 @@ extern "C" {
46int mtdev_init(struct mtdev *dev); 55int mtdev_init(struct mtdev *dev);
47 56
48/** 57/**
58 * mtdev_set_mt_event - set event type
59 * @dev: the mtdev in use
60 * @code: the ABS_MT code to set
61 * @value: boolean value
62 *
63 * Returns true if the given event code is present.
64 */
65void mtdev_set_mt_event(struct mtdev *dev, int code, int value);
66
67/**
68 * mtdev_set_abs_<property> - set abs event property
69 * @dev: the mtdev in use
70 * @code: the ABS_MT code to set
71 */
72void mtdev_set_abs_minimum(struct mtdev *dev, int code, int value);
73void mtdev_set_abs_maximum(struct mtdev *dev, int code, int value);
74void mtdev_set_abs_fuzz(struct mtdev *dev, int code, int value);
75void mtdev_set_abs_resolution(struct mtdev *dev, int code, int value);
76
77/**
49 * mtdev_configure - configure the mtdev converter 78 * mtdev_configure - configure the mtdev converter
50 * @dev: the mtdev to configure 79 * @dev: the mtdev to configure
51 * @fd: file descriptor of the kernel device 80 * @fd: file descriptor of the kernel device
@@ -106,6 +135,14 @@ int mtdev_empty(struct mtdev *dev);
106 */ 135 */
107void mtdev_get_event(struct mtdev *dev, struct input_event* ev); 136void mtdev_get_event(struct mtdev *dev, struct input_event* ev);
108 137
138/**
139 * mtdev_delete - free a previously allocated mtdev
140 *
141 * Frees the memory associated with the mtdev and invalidates the
142 * mtdev pointer.
143 */
144void mtdev_delete(struct mtdev *dev);
145
109#ifdef __cplusplus 146#ifdef __cplusplus
110} 147}
111#endif 148#endif