From 56a77e68fb91eef928d8a95c50ae14508e37ae0f Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 22 Dec 2010 18:29:00 +0100 Subject: 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 --- include/mtdev-plumbing.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'include/mtdev-plumbing.h') 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 @@ -35,6 +35,15 @@ extern "C" { #include +/** + * mtdev_new - allocate a new mtdev + * + * Allocate a new mtdev. + * + * Returns zero in case of memory allocation failure. + */ +struct mtdev *mtdev_new(void); + /** * mtdev_init - initialize mtdev converter * @dev: the mtdev to initialize @@ -45,6 +54,26 @@ extern "C" { */ int mtdev_init(struct mtdev *dev); +/** + * mtdev_set_mt_event - set event type + * @dev: the mtdev in use + * @code: the ABS_MT code to set + * @value: boolean value + * + * Returns true if the given event code is present. + */ +void mtdev_set_mt_event(struct mtdev *dev, int code, int value); + +/** + * mtdev_set_abs_ - set abs event property + * @dev: the mtdev in use + * @code: the ABS_MT code to set + */ +void mtdev_set_abs_minimum(struct mtdev *dev, int code, int value); +void mtdev_set_abs_maximum(struct mtdev *dev, int code, int value); +void mtdev_set_abs_fuzz(struct mtdev *dev, int code, int value); +void mtdev_set_abs_resolution(struct mtdev *dev, int code, int value); + /** * mtdev_configure - configure the mtdev converter * @dev: the mtdev to configure @@ -106,6 +135,14 @@ int mtdev_empty(struct mtdev *dev); */ void mtdev_get_event(struct mtdev *dev, struct input_event* ev); +/** + * mtdev_delete - free a previously allocated mtdev + * + * Frees the memory associated with the mtdev and invalidates the + * mtdev pointer. + */ +void mtdev_delete(struct mtdev *dev); + #ifdef __cplusplus } #endif -- cgit v1.2.3