Change signature for kernel_enable_event_code to match enable_event_code

They do essentially the same thing, so the function signature should be null.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-06-29 18:25:30 +10:00
parent f456a9dce4
commit ea8c69c3e4
2 changed files with 20 additions and 4 deletions

View file

@ -863,7 +863,8 @@ libevdev_kernel_enable_event_type(struct libevdev *dev, unsigned int type)
}
int
libevdev_kernel_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code)
libevdev_kernel_enable_event_code(struct libevdev *dev, unsigned int type,
unsigned int code, const void *data)
{
int rc;
int uinput_bit;
@ -890,9 +891,18 @@ libevdev_kernel_enable_event_code(struct libevdev *dev, unsigned int type, unsig
}
rc = ioctl(dev->fd, uinput_bit, type);
if (rc != -1)
libevdev_enable_event_type(dev, type);
if (rc == -1)
goto out;
rc = libevdev_enable_event_type(dev, type);
if (rc == -1)
goto out;
/* FIXME: can't back out of this if it fails */
if (type == EV_ABS)
rc = libevdev_kernel_set_abs_value(dev, code, (const struct input_absinfo*)data);
out:
return (rc != -1) ? 0 : -errno;
}

View file

@ -737,12 +737,18 @@ int libevdev_kernel_enable_event_type(struct libevdev *dev, unsigned int type);
* This cannot be undone, the kernel only allows to enable axes, not disable
* them.
*
* The last argument depends on the type and code:
* - If type is EV_ABS, the vararg must be a pointer to a struct input_absinfo
* containing the data for this axis.
* - For all other types, the argument is ignored.
*
* This function calls libevdev_kernel_enable_event_type() if necessary.
*
* @param type The event type to enable (EV_ABS, EV_KEY, ...)
* @param code The event code to enable (ABS_X, REL_X, etc.)
* @param data Axis/key data, depending on type and code
*/
int libevdev_kernel_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code);
int libevdev_kernel_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code, const void *data);
/**
* @ingroup kernel