../tools/shared.c:132:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The previous API was inconsistent and different to the rest of libratbag's
API. Replace with one where a macro is a separate struct, can be initialized
and then written to the device with a set_macro() call. The device copies the
contents, the macro is otherwise unmodified and can be re-used by the client
if need be.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Whenever we do something that may fail, return an enum of possible errors.
This also changes the API for ratbag_device_new_from_udev_device() to return
an error code now too instead of just NULL on failure.
Error numbers start at -1000 to avoid overlap with errnos, error_code() should
be used internally to avoid returning an errno.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Setting the special command and displaying it were using a different
spelling. Fix that.
We should really only have one entry point for that.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_ALTERNATE (for the "sniper switch")
RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_DEFAULT -> means what it means
And fix one missing entry in str_to_special_action.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Blows up when sprintf encounters an error, the result string is empty or the
result string is truncated.
Note: sprintf_safe only works on static buffers, it uses ARRAY_LENGTH.
Fixes#14
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This driver is basically a duplicate of the Etekcity.
After the copy-paste, I renamed all the the "etekcity"
by "roccat" and then rev-engineered the various constants.
Still a WIP, but it is getting usable.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The doctext needs fixes and the API might not be final.
This however works and allow to read the macro.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>