summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-11-01Provide separate lookup functions for zero-terminated stringsHEADmasterPeter Hutterer3-64/+112
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-31Add name-resolver unit testsDavid Herrmann3-0/+120
A bunch of tests for the new name resolver. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31Add libevdev_event_type/code_from_name() resolversDavid Herrmann4-0/+178
Three new helpers are added: (1) libevdev_event_type_from_name() takes a string describing an EV_* event type and returns the given event-type constant. (2) libevdev_event_code_from_name() takes a string describing an event code and returns the given event-code constant. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31Create event type/code lookup tablesDavid Herrmann1-4/+59
Additionally to type->string mapping tables we now also create string->type lookup tables. The lookup tables are sorted by their name so binary-search will work. We create one lookup table for EV_* types and one for all event-codes. More tables (like bus-names, input-properties, ..) can be added later. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31Add startswith() helperDavid Herrmann1-0/+8
Simple helper that use strncmp() to test whether a given string starts with a given suffix. While it doesn't reduce code-size by much, it is a lot more readable than the strncmp() usage. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31Fix wrong libevdev clock testDavid Herrmann1-2/+5
We can rely on CLOCK_MONOTONIC and CLOCK_REALTIME to be different at any time. However, this does not apply to the ms/us/ns parts of the current time. Both may be in sync regarding the current micro-seconds state. So remove the wrong clock us-comparison. I was able to trigger this on my machine. Chances that both are in sync are very low so I assume my RTC only provides low granularity and thus both clocks are sync during boot for higher granularity. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31Require autoconf 2.62Peter Hutterer1-1/+1
According to Gaetan, that's what we really require. And as a bonus point, this makes libevdev build on RHEL6 out-of-the-box. CC: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-24Check max to see if an event type is validPeter Hutterer2-2/+20
There's a gap in the range between EV_SW and EV_LED. Trying to enable one of those bits will segfault. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-24Make sure EV_SYN is always setPeter Hutterer1-1/+2
Set the bit during device reset and make sure that if we're checking for the event type we always return true for EV_SYN. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-24Disallow disabling EV_SYN event codesPeter Hutterer2-1/+2
The documentation already says that, make it happen. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23Reset the struct on set_fdPeter Hutterer1-7/+19
libevdev_set_fd may fail at a number of points. If it does, it errors out but does nothing otherwise. Thus, a client may call set_fd again for the same struct but on a different fd and have it succeed. Depending on when set_fd bailed out the first time, some fields may already be set. Thus, reset the whole struct at set_fd time to make sure we're nulled out appropriately. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23Revert "Check for linux/input.h during configure"Peter Hutterer1-3/+0
We now ship our own linux/input.h, so no need to have the header around locally. This reverts commit fcf80ba3713b9d92480dc8be9ec4d88d95586ec0.
2013-10-23Document backwards-compatibility behaviourPeter Hutterer1-0/+56
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-23Work around missing EVIOCGMTSLOTS ioctlPeter Hutterer1-2/+12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-23Make uinput-code backwards-compatible to missing UI_SET_PROPBIT ioctlPeter Hutterer1-1/+18
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23When running against a kernel without properties, continue as usualPeter Hutterer1-1/+5
Missing out on properties is not fatal. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-23Pass linux/input.h as argument to make-event-names.pyPeter Hutterer2-7/+6
Rather than a hardcoded path inside the source. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-23Add a copy of linux/input.hPeter Hutterer5-6/+1173
This avoids a number of otherwise required ifdefs when building on older kernels Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-21configure: test for python and python-argparsePeter Hutterer2-1/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-14Don't allow a negative fd in libevdev_set_fdPeter Hutterer1-1/+2
Everything else responds with -EBADF, let's do so here as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-14Allow -1 as valid fd in libevdev_change_fdPeter Hutterer2-14/+25
Add a new flag for "initialized" and separate that from the fd logic. This way, we can call libevdev_change_fd(dev, -1) to signal that the current fd should be dropped. Otherwise libevdev can't be told to release the fd and always keeps a reference to it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-08Check for linux/input.h during configurePeter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-08Uppercase #define LIBEVDEV_INT_HPeter Hutterer1-2/+2
over-eager search/replace Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-04Note that libevdev_change_fd requires a LIBEVDEV_FORCE_SYNCPeter Hutterer1-0/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-04Mark three deprecated functions as suchPeter Hutterer3-21/+21
These are deprecated, but were missing the deprecated attribute. And fix up the tests that were still using those deprecated calls. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-02Use AC_MSG_RESULT to print the few configuration optionsPeter Hutterer1-1/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-10-02Disable gcov by defaultPeter Hutterer1-2/+2
Having libevdev build with profiling enabled by default leaves profiling files around. Profiling is something that only libevdev developers should need, so let them enable it case-by-case. https://bugzilla.redhat.com/show_bug.cgi?id=1012180 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-24Avoid shipping generated documentation twiceStephen Kitt1-1/+1
Only add files to EXTRA_DIST, to avoid having a full copy of doc/html as doc/html/html in the distributed tarball. Signed-off-by: Stephen Kitt <skitt@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-19Add extern C guards to libevdev-uinput.hPeter Hutterer1-0/+7
Reported-by: Stanisław Halik <sthalik@misaki.pl> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-19Capitalize uinput header guardsPeter Hutterer1-3/+3
victim of some overly vicious search/replace Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-18libevdev 0.4libevdev-0.4Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-18Print an error on an invalid log priorityPeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-18Merge branch 'clockid'Peter Hutterer5-0/+142
2013-09-17tools: make to function calls staticPeter Hutterer1-2/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-17Fix a typo in the uinput documentationPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-17Move libevdev_led_value documentation to the kernel groupPeter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-17tools: Honor GCC_CFLAGSColin Walters1-1/+1
So we get compiler warnings from tools/ too. Signed-off-by: Colin Walters <walters@verbum.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-16Drop duplicate compiler flagPeter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-16Revert "Reintroduce -fstack-protector"Peter Hutterer1-1/+0
http://lists.freedesktop.org/archives/input-tools/2013-September/000332.html See above a detailed reasoning, but Colin Walters put it this way: "At a high level, I think components (git repositories) should feel free to set up default warning flags and possibly use a targeted subset of -Werror=foo. But please don't inject non-warning flags like this unless there is a very good reason. The right way to do -fstack-protector is to have something like redhat-rpm-config or other global CFLAGS system controlling *all* components." Thus, reverting the -fstack-protector flag. This doesn't completely address Colin's comments, we still use a few other flags. But this one is the one that causes real headaches, so drop it. This reverts commit f5e65ea3ce2541fe8ccfafe9b0dd04325da75b34.
2013-09-13Reintroduce -fstack-protectorDavid Herrmann1-0/+1
We removed this previously due to build failures in: commit 14ac764ec86452ca607403f314b0f8355d80290c Author: David Herrmann <dh.herrmann@gmail.com> Date: Mon Sep 9 16:03:41 2013 +0200 build: remove -fstack-protector Reintroduce it but this time disable it if it's not supported. We use the CC-flags testing to prevent build-failures on gcc without libssp support. Cc: Giovanni Campagna <gcampagn@redhat.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-13Test for CFLAGS/LFLAGS availabilityDavid Herrmann2-5/+313
Use the CC_CHECK_FLAGS_APPEND() m4 macro to test for availability of CFLAGS and LFLAGS. It automatically drops the unavailable flags. This is also used by systemd, so it ought to work with ostree and other non-standard build-environments. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-13wrap EVIOCSCLOCKID into an API callPeter Hutterer3-0/+135
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-13test: provide wrapper for fetching the devnode from a uinput test devicePeter Hutterer2-0/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-12test: add a test for checking log data being passed around correctlyPeter Hutterer1-0/+38
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-12Fix a comment to reflect the new APIPeter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-11Remove warning comment from FORCE_SYNCPeter Hutterer1-3/+2
There is a legitimate reason for clients to force a sync on the device. X.Org drivers lose the fd when the device is disabled and re-enabled. When the device comes back, a simple libevdev_change_fd() doesn't update the status on the device. Button states, etc. may have changed, etc. So a driver may call FORCE_SYNC after re-connecting to the fd to make sure the library and the driver get the current state of the device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-11Name-space the read flags betterPeter Hutterer7-83/+95
Rename from LIBEVDEV_READ_foo to LIBEVDEV_READ_FLAG_foo to differentiate better from LIBEVDEV_READ_STATUS_foo. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-11Enumerate libevdev_next_event() return codesPeter Hutterer4-66/+89
Improved readability in callers, changing magic numbers 0 and 1 to rc = libevdev_next_event(); if (rc == LIBEVDEV_READ_STATUS_SUCCESS) do_something(); else if (rc == LIBEVDEV_READ_STATUS_SYNC) do_something_else() No ABI changes, the enum values are the previously documented values, this is just a readability improvement. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-11Require check 0.9.9Peter Hutterer1-1/+1
0.9.9 is the first released version with fixed ck_assert_* macros that don't do multiple expansion. http://sourceforge.net/p/check/code/596/ Reported-by: Martin Minarik <minarik11@student.fiit.stuba.sk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-11Fix comment typoPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>