Peter Hutterer [Wed, 12 Feb 2014 05:44:33 +0000 (15:44 +1000)]
Use 0 instead of "zero"
We're a bit inconsistent here anyway because of the ample use of "non-zero"
which can't really be converted to non-0. But let's at least be consistent
with the use of 0 instead of zero.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 12 Feb 2014 05:28:34 +0000 (15:28 +1000)]
More documentation fixes and improvements
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 12 Feb 2014 05:21:42 +0000 (15:21 +1000)]
Mark a few more functions as signal-safe
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 11 Feb 2014 06:31:35 +0000 (16:31 +1000)]
Improve the documentation a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 11 Feb 2014 06:37:14 +0000 (16:37 +1000)]
Document that we don't support EVIOCREVOKE
This is intentional, see
http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 11 Feb 2014 06:27:50 +0000 (16:27 +1000)]
README: remove the warning, it's stable now
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 29 Jan 2014 05:09:05 +0000 (15:09 +1000)]
libevdev 0.9.1
libevdev 1.0-rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 29 Jan 2014 05:08:12 +0000 (15:08 +1000)]
test: remove NULL test for SW_MAX, 3.13 defines SW_MUTE_DEVICE
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 2 Jan 2014 23:44:13 +0000 (09:44 +1000)]
Bump soname
Bump once to the stable interface we have now. This isn't really required as
we're compatible with everything but functions deprecated with 0.4 but we
might as well do it now to force a rebuild of everyone. Should've done that
for 0.6 when we actually dropped the function, but ...
Now that we have proper library versioning we shouldn't need any
backwards-incompatible soname bumps for a while.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
David Herrmann [Sat, 17 Aug 2013 11:58:15 +0000 (13:58 +0200)]
Add ld version-script
Explicit symbol versioning allows us to provide multiple versions of
incompatible API changes. It is a very common practice in GNU world and
avoids the problems occuring if distributions try to ship multiple version
of a single DSO.
Background information available at:
http://people.redhat.com/drepper/dsohowto.pdf
To see the symbol-versions, use objdump:
objdump -T libevdev/.libs/libevdev.so.1.0.0
This can also be used to verify that all symbols are correctly
exported (typos in linker-scripts are silently ignored by ld).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Updated for evdev 0.6's API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Jan 2014 22:27:31 +0000 (08:27 +1000)]
include: update linux/input.h for kernel 3.13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 17 Jan 2014 00:15:33 +0000 (10:15 +1000)]
Warn about a SYN_DROPPED right after finishing a sync
If the first event after a completed device sync is a SYN_DROPPED, warn the
user that they're not fast enough handling this device.
The test for this is rather complicated since we can't write SYN_DROPPED
through uinput so we have to juggle the device fd and a pipe and switch
between the two at the right time (taking into account that libevdev will read
events from the fd whenever it can).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 17 Jan 2014 00:21:48 +0000 (10:21 +1000)]
test: abort on unexpected log messages
Add two log functions, one that aborts on a received message. We know when we
expect to receive an error, so anytime this happens unexpectedly should
terminate the test.
And for those tests do issue a log message, let them ignore it and don't
print anything.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 16 Jan 2014 23:24:20 +0000 (09:24 +1000)]
Count the number of events needed for a full sync
Make sure we have a queue that is at least large enough to do a full sync
after a SYN_DROPPED, plus store a few extra events in case some came in after
the sync.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Thu, 16 Jan 2014 23:47:39 +0000 (09:47 +1000)]
test: fix typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 16 Jan 2014 23:46:09 +0000 (09:46 +1000)]
test: rename a test to match what it's testing better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 14 Jan 2014 04:18:06 +0000 (14:18 +1000)]
Drop the argparse requirement for make-event-names.py
We only take one option (path to linux/input.h) anyway so drop the argparse
requirement. This way libevdev builds on RHEL6 too which doesn't ship
argparse.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Tue, 14 Jan 2014 04:08:29 +0000 (14:08 +1000)]
Drop --output flag and python generation code from make-event-names.py
This is a leftover from when the file was in evemu and used to generate python
headers too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Wed, 8 Jan 2014 00:52:31 +0000 (10:52 +1000)]
include: update linux/input.h for kernel 3.12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Mon, 23 Dec 2013 22:19:16 +0000 (08:19 +1000)]
test: detect if we're running inside gdb and disable forking
The Check test framework forks by default which is annoying when running gdb.
Try to detect whether we're inside gdb by ptracing ourselves. If that works,
we're not inside a debugger. If it doesn't, then assume we're inside a
debugger and set CK_FORK to "no".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 23 Dec 2013 23:12:13 +0000 (09:12 +1000)]
Documentation rewordings and additions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 23 Dec 2013 23:11:55 +0000 (09:11 +1000)]
Documentation typo fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 23 Dec 2013 23:10:47 +0000 (09:10 +1000)]
Add more cross-references
doxygen doesn't detect enum cross-references automatically, prefix them with
@ref
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 23 Dec 2013 22:07:00 +0000 (08:07 +1000)]
doc: remove initial * from example code lines
doxygen actually copies that over into the resulting output.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 23 Dec 2013 07:38:07 +0000 (17:38 +1000)]
libevdev 0.6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 12 Dec 2013 03:13:54 +0000 (13:13 +1000)]
test: add basic link test
This test doesn't do anything but compile and link against libevdev. It's a
simple protection to avoid linker errors. If we ever have libs we depend on
and they don't get resolved properly, this test should warn us in time.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 12 Dec 2013 02:57:21 +0000 (12:57 +1000)]
test: split tests into run-time and build-time tests
The build-time tests don't do anything, we don't need to run them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Nov 2013 01:58:08 +0000 (11:58 +1000)]
Don't treat devices with (ABS_MT_SLOT - 1) as multitouch devices
Some devices (PS3 sixaxis controller) merely have a bunch of axes, without the
semantic information that linux/input.h requires. For those, the ABS_MT range
may be merely another axis, not the special range that we need to treat it
with.
Use a simple heuristic: if ABS_MT_SLOT - 1 is enabled, don't treat ABS_MT as
multitouch axes. The ABS_MT_SLOT - 1 axis is not used for a real axis.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Sun, 8 Dec 2013 23:49:43 +0000 (09:49 +1000)]
Merge branch 'ev-rep-handling'
Peter Hutterer [Fri, 6 Dec 2013 02:44:33 +0000 (12:44 +1000)]
State that the event is defined for a SYN_DROPPED
All clients that want to handle SYN_DROPPED correctly need to pass an EV_SYN
through their own handlers before starting with the syn events. Rather than
letting them synthesize that, guarantee that the event is defined the first
time LIBEVDEV_READ_STATUS_SYNC is returned.
This does not change existing behavior, it merely documents it so we can rely
on it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 4 Dec 2013 10:21:09 +0000 (20:21 +1000)]
Support EV_REP values through libevdev_get_event_value
We shouldn't have a separate API for that, the whole point of libevdev is to
abstract the quirkyness of the ioctls into a common interface. So let's
export the two EV_REP values through libevdev_get_event_value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Wed, 4 Dec 2013 10:15:28 +0000 (20:15 +1000)]
Constify libevdev_get_repeat
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 4 Dec 2013 09:50:06 +0000 (19:50 +1000)]
Move the testing part to a separate page
Not something that interests the average visitor of the front page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 4 Dec 2013 09:48:43 +0000 (19:48 +1000)]
Add a doxygen page listing the ioctls and their current support
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Sun, 8 Dec 2013 22:42:17 +0000 (08:42 +1000)]
doc: add a placeholder man page
We don't provide man pages (the ones created by doxygen are pretty
terrible) so provide a placeholder page to provide the minimum info and point
people in the right direction.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 4 Dec 2013 10:03:24 +0000 (20:03 +1000)]
Documentation fix, refer to correct function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 4 Dec 2013 09:46:50 +0000 (19:46 +1000)]
Fix a typo in the documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
David Herrmann [Mon, 4 Nov 2013 14:43:57 +0000 (15:43 +0100)]
build: set aux-dir
If we don't set AUX_DIR, I get errors during ./configure:
/bin/sh: /home/david/missing: No such file or directory
configure: WARNING: 'missing' script is too old or missing
This error is ignored by default, but may cause failures with newer
autoconf versions. Simply set the AUX_DIR to "build-aux" like many other
autotools projects do.
[This is an automake 1.14 bug, see the upstream report:
http://lists.gnu.org/archive/html/bug-automake/2013-11/msg00007.html]
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>
Peter Hutterer [Thu, 28 Nov 2013 07:50:36 +0000 (17:50 +1000)]
Drop some leftover deprecated constants.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Mon, 25 Nov 2013 16:13:02 +0000 (11:13 -0500)]
test-compile-pedantic: replace -Wpedantic with -pedantic
-Wpedantic is a relatively new option, with -pedantic being the old version of
it that works on older gcc versions too.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Mon, 25 Nov 2013 16:08:26 +0000 (11:08 -0500)]
doxygen: specifying builddir is not required
For the scenarios the module supports it is not required to
be specified.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:33 +0000 (08:02 -0500)]
doxygen: fix 'dist' when the html docs have not yet been built
The reason why this did not work is that we do not have a fixed list
of html doc files and it would be pain to maintain.
The 'find' hack gets a list of html files but only when the package
has already been built. Let's complement this hack with the
html/index.html file which act as a build trigger as it is the target name.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:30 +0000 (08:02 -0500)]
doxygen: fix rebuild when not necessary
Everytime make is invoked, doxygen is invoked to generate the html doc.
Dependencies are added so it does rebuild when necessary.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:29 +0000 (08:02 -0500)]
doxygen: fix error msg: 'find: `html': No such file or directory'
Every time a make target is run in the doc directory when the html dir
is absent, you get this error. Even with 'make clean'.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:28 +0000 (08:02 -0500)]
doxygen: remove redundant "dist_noinst_DATA = libevdev.doxygen.in" statement
All .in files in AC_CONFIG_FILES are distributed.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:27 +0000 (08:02 -0500)]
doxygen: implement silent rules in the makefile
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:26 +0000 (08:02 -0500)]
doxygen: invocation of doxygen fails due to hard coded path
The makefile does not use $(DOXYGEN) variable.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Sun, 24 Nov 2013 13:02:25 +0000 (08:02 -0500)]
doxygen: libevdev.doxygen must not be distributed
It reflects the values on the build machine.
Same pattern as libevdev.pc vs libevdev.pc.in.
For example, in libevdev.doxygen:
HTML_EXTRA_STYLESHEET = ./libevdev.css
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 22 Nov 2013 02:15:19 +0000 (12:15 +1000)]
test: add a build test for -Wpedantic
A user of libevdev may be compiled with -Wpedantic. Our header files should
not produce any warnings, so add a simple test that merely includes both
public header files and compiles with -Wpedantic -Werror.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Fri, 22 Nov 2013 00:30:14 +0000 (10:30 +1000)]
Drop semicolons after getter/setter macros
libevdev.c:921:134: warning: ISO C does not allow extra ';' outside of a
function [-Wpedantic]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Fri, 22 Nov 2013 00:24:29 +0000 (10:24 +1000)]
Drop trailing comma from last element in the enums
If a caller is compiled with -pedantic, this causes a few complaints
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Fri, 22 Nov 2013 00:23:55 +0000 (10:23 +1000)]
Drop deprecated functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Thu, 21 Nov 2013 23:43:31 +0000 (09:43 +1000)]
libevdev 0.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 19 Nov 2013 16:59:10 +0000 (11:59 -0500)]
python: request version 2.6 or higher
This seems like a reasonable minimum version to require.
Available in RHEL6 (2010) or Ubuntu (2010).
Version 2.7 contains the argparse module so the check could be removed.
The argparse module was introduced in v2.3.5 as an optional module.
http://www.python.org/doc/versions/
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 19 Nov 2013 16:58:54 +0000 (11:58 -0500)]
configure.ac: remove redundant AC_SUBST(PYTHON)
This is already done by AM_PATH_PYTHON.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 19 Nov 2013 16:58:45 +0000 (11:58 -0500)]
configure.ac: AC_PROG_CC_C99: use C99 compiler
Given the close ties with input drivers and xserver, might
as well use the same level of compiler.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 19 Nov 2013 16:57:38 +0000 (11:57 -0500)]
configure.ac: add copyright statement
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Tue, 19 Nov 2013 16:56:40 +0000 (11:56 -0500)]
configure.ac: AC_INIT: add bug report url
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Mon, 18 Nov 2013 20:17:12 +0000 (15:17 -0500)]
autogen.sh: remove unneeded m4 configuration workaround
Creating the m4 directory is not required under any circumstances
when the package is properly configured. We have git files under m4.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Mon, 18 Nov 2013 20:15:58 +0000 (15:15 -0500)]
autogen.sh: fix broken out-of-source tree building
The configure script is invoked from the build directory rather than
from the source directory.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Fri, 15 Nov 2013 20:55:04 +0000 (15:55 -0500)]
Review/update .gitignore files
Merge potentially useful patterns taken from other projects.
Some application specific patterns were move to their respective directories.
The only noticeable change is that *.patch is ignore to prevent accidental
checkin of patches. The pattern "test-driver" could not be found and was
removed.
The test directory had not been updated since the move of all test cases
in a single binary.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 18 Nov 2013 03:52:37 +0000 (13:52 +1000)]
Drop gcov flags from main libevdev sources
We recompile the sources anyway in the tests and we have our own CFLAGS there.
Drop them from the main library code so we don't leave gcov files everywhere.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
David Herrmann [Sun, 17 Nov 2013 12:44:02 +0000 (07:44 -0500)]
build: check for build/link flags harder
Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE to test for flags that
might succeed during compilation but not during linking. An example is gcc
compiled with libssp support but gnu-ld without it. In this case
-fstack-protector works fine during compilation but fails during linking
as several internal helpers are missing.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Thu, 14 Nov 2013 22:29:43 +0000 (17:29 -0500)]
Update COPYING file.
The file must reflect actual Copyright statements in the source code.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
David Herrmann [Tue, 5 Nov 2013 06:58:24 +0000 (07:58 +0100)]
build: set AC_CONFIG_SRCDIR
This macro is used to verify that $srcdir is set correctly by testing for
existance of the passed file. Shouldn't hurt setting it to catch wrong
build setups.
Cc: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 31 Oct 2013 01:37:33 +0000 (11:37 +1000)]
Provide separate lookup functions for zero-terminated strings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
David Herrmann [Wed, 30 Oct 2013 07:45:27 +0000 (08:45 +0100)]
Add name-resolver unit tests
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>
David Herrmann [Wed, 30 Oct 2013 07:44:48 +0000 (08:44 +0100)]
Add libevdev_event_type/code_from_name() resolvers
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>
David Herrmann [Mon, 28 Oct 2013 16:16:45 +0000 (17:16 +0100)]
Create event type/code lookup tables
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>
David Herrmann [Wed, 30 Oct 2013 07:24:43 +0000 (08:24 +0100)]
Add startswith() helper
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>
David Herrmann [Mon, 28 Oct 2013 16:16:43 +0000 (17:16 +0100)]
Fix wrong libevdev clock test
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>
Peter Hutterer [Tue, 29 Oct 2013 03:46:14 +0000 (13:46 +1000)]
Require autoconf 2.62
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>
Peter Hutterer [Thu, 24 Oct 2013 04:30:40 +0000 (14:30 +1000)]
Check max to see if an event type is valid
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>
Peter Hutterer [Thu, 24 Oct 2013 04:21:31 +0000 (14:21 +1000)]
Make sure EV_SYN is always set
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>
Peter Hutterer [Thu, 24 Oct 2013 04:18:30 +0000 (14:18 +1000)]
Disallow disabling EV_SYN event codes
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>
Peter Hutterer [Tue, 22 Oct 2013 01:27:42 +0000 (11:27 +1000)]
Reset the struct on set_fd
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>
Peter Hutterer [Mon, 14 Oct 2013 05:15:46 +0000 (15:15 +1000)]
Revert "Check for linux/input.h during configure"
We now ship our own linux/input.h, so no need to have the header around locally.
This reverts commit
fcf80ba3713b9d92480dc8be9ec4d88d95586ec0.
Peter Hutterer [Thu, 10 Oct 2013 01:22:48 +0000 (11:22 +1000)]
Document backwards-compatibility behaviour
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 8 Oct 2013 04:21:14 +0000 (14:21 +1000)]
Work around missing EVIOCGMTSLOTS ioctl
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 8 Oct 2013 03:43:20 +0000 (13:43 +1000)]
Make uinput-code backwards-compatible to missing UI_SET_PROPBIT ioctl
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Tue, 8 Oct 2013 03:09:50 +0000 (13:09 +1000)]
When running against a kernel without properties, continue as usual
Missing out on properties is not fatal.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 14 Oct 2013 05:40:51 +0000 (15:40 +1000)]
Pass linux/input.h as argument to make-event-names.py
Rather than a hardcoded path inside the source.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 14 Oct 2013 04:28:46 +0000 (14:28 +1000)]
Add a copy of linux/input.h
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>
Peter Hutterer [Mon, 14 Oct 2013 05:28:16 +0000 (15:28 +1000)]
configure: test for python and python-argparse
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Peter Hutterer [Tue, 8 Oct 2013 05:27:27 +0000 (15:27 +1000)]
Don't allow a negative fd in libevdev_set_fd
Everything else responds with -EBADF, let's do so here as well.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 8 Oct 2013 05:16:32 +0000 (15:16 +1000)]
Allow -1 as valid fd in libevdev_change_fd
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>
Peter Hutterer [Tue, 8 Oct 2013 03:01:07 +0000 (13:01 +1000)]
Check for linux/input.h during configure
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 8 Oct 2013 04:22:27 +0000 (14:22 +1000)]
Uppercase #define LIBEVDEV_INT_H
over-eager search/replace
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 4 Oct 2013 06:15:43 +0000 (16:15 +1000)]
Note that libevdev_change_fd requires a LIBEVDEV_FORCE_SYNC
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 4 Oct 2013 06:00:38 +0000 (16:00 +1000)]
Mark three deprecated functions as such
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>
Peter Hutterer [Tue, 1 Oct 2013 23:55:08 +0000 (09:55 +1000)]
Use AC_MSG_RESULT to print the few configuration options
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Tue, 1 Oct 2013 23:40:43 +0000 (09:40 +1000)]
Disable gcov by default
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>
Stephen Kitt [Sun, 22 Sep 2013 17:34:24 +0000 (19:34 +0200)]
Avoid shipping generated documentation twice
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>
Peter Hutterer [Wed, 18 Sep 2013 22:32:00 +0000 (08:32 +1000)]
Add extern C guards to libevdev-uinput.h
Reported-by: Stanisław Halik <sthalik@misaki.pl>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 18 Sep 2013 22:31:33 +0000 (08:31 +1000)]
Capitalize uinput header guards
victim of some overly vicious search/replace
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 18 Sep 2013 04:38:26 +0000 (14:38 +1000)]
libevdev 0.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 18 Sep 2013 04:37:35 +0000 (14:37 +1000)]
Print an error on an invalid log priority
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 18 Sep 2013 01:44:06 +0000 (11:44 +1000)]
Merge branch 'clockid'
Peter Hutterer [Tue, 17 Sep 2013 10:10:18 +0000 (20:10 +1000)]
tools: make to function calls static
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 17 Sep 2013 02:26:21 +0000 (12:26 +1000)]
Fix a typo in the uinput documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>