summaryrefslogtreecommitdiff
path: root/libevdev/libevdev-util.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>