[PATCH evemu 1/7] Un-constify evemu_create()'s evemu_device struct argument

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 21 16:19:56 PST 2013


Having the 'create' API take a const argument is a really bad idea, it makes
it impossible to store any data inside the struct that would be useful on
creation. This includes automatically setting the node name on creation, or,
more importantly here, enabling a new libevdev backend.

Since this is an ABI break, bump the libtool version.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 configure.ac     | 2 +-
 src/evemu.c      | 2 +-
 src/evemu.h      | 2 +-
 src/libevemu.ver | 8 ++------
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index ec21a6e..577401f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ AM_MAINTAINER_MODE([enable])
 # - If binary compatibility has been broken (eg removed or changed interfaces)
 #   change to C+1:0:0
 # - If the interface is the same as the previous version, change to C:R+1:A
-LIB_VERSION=2:0:1
+LIB_VERSION=3:0:0
 AC_SUBST([LIB_VERSION])
 
 # Initialize libtool
diff --git a/src/evemu.c b/src/evemu.c
index d984718..15040a9 100644
--- a/src/evemu.c
+++ b/src/evemu.c
@@ -897,7 +897,7 @@ static int set_mask(const struct evemu_device *dev, int type, int fd)
 	return 0;
 }
 
-int evemu_create(const struct evemu_device *dev, int fd)
+int evemu_create(struct evemu_device *dev, int fd)
 {
 	struct uinput_user_dev udev;
 	int ret, i;
diff --git a/src/evemu.h b/src/evemu.h
index e930671..4ea4307 100644
--- a/src/evemu.h
+++ b/src/evemu.h
@@ -418,7 +418,7 @@ int evemu_play(FILE *fp, int fd);
  *
  * Returns zero if successful, negative error otherwise.
  */
-int evemu_create(const struct evemu_device *dev, int fd);
+int evemu_create(struct evemu_device *dev, int fd);
 
 /**
  * evemu_destroy() - destroy all created kernel devices
diff --git a/src/libevemu.ver b/src/libevemu.ver
index a9e6bf4..24ae0ce 100644
--- a/src/libevemu.ver
+++ b/src/libevemu.ver
@@ -1,4 +1,4 @@
-EVEMU_1.0 {
+EVEMU_2.0 {
   global:
     evemu_create;
     evemu_create_event;
@@ -19,6 +19,7 @@ EVEMU_1.0 {
     evemu_get_version;
     evemu_has_event;
     evemu_has_prop;
+    evemu_has_bit;
     evemu_new;
     evemu_play;
     evemu_play_one;
@@ -42,8 +43,3 @@ EVEMU_1.0 {
   local:
     *;
 };
-
-EVEMU_1.1 {
-  global:
-    evemu_has_bit;
-} EVEMU_1.0;
-- 
1.8.3.1



More information about the Input-tools mailing list