[PATCH v2 libevdev] Rename enums to match lower_case format
Peter Hutterer
peter.hutterer at who-t.net
Wed Aug 14 20:44:39 PDT 2013
This is technically an API, but not an ABI change.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
on second thought, it's not so much the typedef as the weird and
inconsistent naming that bothers me.
libevdev/libevdev.c | 8 ++++----
libevdev/libevdev.h | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
index e59d795..8151026 100644
--- a/libevdev/libevdev.c
+++ b/libevdev/libevdev.c
@@ -1091,7 +1091,7 @@ libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const stru
}
int
-libevdev_grab(struct libevdev *dev, int grab)
+libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab)
{
int rc = 0;
@@ -1188,7 +1188,7 @@ libevdev_get_repeat(struct libevdev *dev, int *delay, int *period)
}
int
-libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum EvdevLEDValues value)
+libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum libevdev_led_value value)
{
return libevdev_kernel_set_led_values(dev, code, value, -1);
}
@@ -1197,7 +1197,7 @@ int
libevdev_kernel_set_led_values(struct libevdev *dev, ...)
{
struct input_event ev[LED_MAX + 1];
- enum EvdevLEDValues val;
+ enum libevdev_led_value val;
va_list args;
int code;
int rc = 0;
@@ -1212,7 +1212,7 @@ libevdev_kernel_set_led_values(struct libevdev *dev, ...)
rc = -EINVAL;
break;
}
- val = va_arg(args, enum EvdevLEDValues);
+ val = va_arg(args, enum libevdev_led_value);
if (val != LIBEVDEV_LED_ON && val != LIBEVDEV_LED_OFF) {
rc = -EINVAL;
break;
diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
index 61553cc..6113f41 100644
--- a/libevdev/libevdev.h
+++ b/libevdev/libevdev.h
@@ -284,7 +284,7 @@
*/
struct libevdev;
-enum EvdevReadFlags {
+enum libevdev_read_flag {
LIBEVDEV_READ_SYNC = 1, /**< Process data in sync mode */
LIBEVDEV_READ_NORMAL = 2, /**< Process data in normal mode */
LIBEVDEV_FORCE_SYNC = 4, /**< Pretend the next event is a SYN_DROPPED. There is
@@ -369,7 +369,7 @@ typedef void (*libevdev_log_func_t)(const char *format, va_list args);
void libevdev_set_log_handler(struct libevdev *dev, libevdev_log_func_t logfunc);
-enum EvdevGrabModes {
+enum libevdev_grab_mode {
LIBEVDEV_GRAB = 3,
LIBEVDEV_UNGRAB = 4,
};
@@ -390,7 +390,7 @@ enum EvdevGrabModes {
* @return 0 if the device was successfull grabbed or ungrabbed, or a
* negative errno in case of failure.
*/
-int libevdev_grab(struct libevdev *dev, int grab);
+int libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab);
/**
* @ingroup init
@@ -1155,7 +1155,7 @@ int libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigne
int libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs);
-enum EvdevLEDValues {
+enum libevdev_led_value {
LIBEVDEV_LED_ON = 3,
LIBEVDEV_LED_OFF = 4,
};
@@ -1173,7 +1173,7 @@ enum EvdevLEDValues {
* @param value Specifies whether to turn the LED on or off
* @return zero on success, or a negative errno on failure
*/
-int libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum EvdevLEDValues value);
+int libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum libevdev_led_value value);
/**
* @ingroup kernel
@@ -1194,7 +1194,7 @@ int libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum
* @note enabling an LED requires write permissions on the device's file descriptor.
*
* @param dev The evdev device, already initialized with libevdev_set_fd()
- * @param ... A pair of LED_* event codes and enum EvdevLEDValues, followed by
+ * @param ... A pair of LED_* event codes and enum libevdev_led_value, followed by
* -1 to terminate the list.
* @return zero on success, or a negative errno on failure
*/
--
1.8.2.1
More information about the Input-tools
mailing list