summaryrefslogtreecommitdiff
path: root/libevdev/libevdev-util.h
Commit message (Collapse)AuthorAgeFilesLines
* Change to the (always intended) MIT licensePeter Hutterer2021-01-251-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to what must've been a copy/paste error many years ago, the license text for libevdev wasn't actually the MIT license. Let's rectify this, it was always MIT intended anyway. To make this more obvious and reduce the chance of copy/paste mistakes, use the SPDX license identifier in the various source files. The two installed public header files have the full license text. All contributors with copyrightable contributions have ACKed the license change to MIT, either in the MR directly [1] or privately in reply to an email. [1] https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/69 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Alexander Dahl <ada@thorsis.com> Acked-by: Andreas Pokorny <andreas.pokorny@canonical.com> Acked-by: Armin K <krejzi@email.com> Acked-by: Benjamin Tissoires <btissoir@redhat.com> Acked-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Deepa Dinamani <deepa.kernel@gmail.com> Acked-by: Emmanuele Bassi <ebassi@gnome.org> Acked-by: Gaetan Nadon <memsize@videotron.ca> Acked-by: George Thomas <georgefsthomas@gmail.com> Acked-by: Michael Forney <mforney@mforney.org> Acked-by: Nayan Deshmukh <nayan26deshmukh@gmail.com> Acked-by: Niclas Zeising <zeising@daemonic.se> Acked-by: Owen W. Taylor <otaylor@fishsoup.net> Acked-by: Peter Seiderer <ps.report@gmx.net> Acked-by: Ran Benita <ran234@gmail.com> Acked-by: Rosen Penev <rosenp@gmail.com> Acked-by: Scott Jann <sjann@knight-rider.org> Acked-by: Thilo Schulz <thilo@tjps.eu> Acked-by: polyphemus <rolfmorel@gmail.com>
* config.h is a local include pathPeter Hutterer2020-02-141-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add fallback min/max for compilers that don't have statement expressionsMichael Forney2020-02-051-0/+5
| | | | | | | | | | | | | | Statement expressions are a GNU C extension and are not available in ISO C. On compilers that don't have them, define these macros as plain conditional expressions, since they are only ever used with expressions that have no side-effects. The statement-expression version is still retained as an added safety measure on GNU-compatible compilers. Signed-off-by: Michael Forney <mforney@mforney.org>
* cosmetic: fix a couple of duplicate/missing empty linesPeter Hutterer2015-03-041-1/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Move some functions/macros between libevdev-int.h and libevdev-util.hPeter Hutterer2014-03-061-56/+17
| | | | | | | | This allows libevdev-util.h to be used by tests, it no longer relies on libevdev internal structs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Add unlikely() macroPeter Hutterer2014-03-061-0/+2
| | | | | | | Taken from systemd. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* Add startswith() helperDavid Herrmann2013-10-311-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>
* Revamp the API once againPeter Hutterer2013-09-101-1/+1
| | | | | | | | | | | | | | | | | Another look at the current API showed some inconsistencies, rectified in this commit: libevdev_kernel_*: modify the underlying kernel device libevdev_event_type_*: something with an event type libevdev_event_code_*: something with an event code libevdev_event_*: struct input_event-related functions (i.e. not device-related) libevdev_property_*: something with a property libevdev_*: anything applying to a device Hopefully that's the last API change. Current symbols deprecated and aliased. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Add the remaining ev bitsPeter Hutterer2013-06-261-0/+10
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Use a macro for type_to_maskPeter Hutterer2013-06-261-34/+21
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix type_to_mask to return -1Peter Hutterer2013-06-261-6/+6
| | | | | | EV_SYN doesn't have a max, so 0 is not enough. returning 0 on failure is a bad idea, as mask is unset.
* Inline the type-to-mask helpersPeter Hutterer2013-06-041-2/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Move utility functions to a separate headerPeter Hutterer2013-06-041-0/+114
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>