mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-08 07:33:53 +01:00
Add a placeholder for the driver data in struct ratbag
So each driver can allocate/destroy memory Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -54,6 +54,8 @@ struct ratbag {
|
||||
struct list profiles;
|
||||
|
||||
unsigned num_buttons;
|
||||
|
||||
void *drv_data;
|
||||
};
|
||||
|
||||
struct ratbag_id {
|
||||
@@ -103,6 +105,18 @@ struct ratbag_button {
|
||||
|
||||
void ratbag_device_init(struct ratbag *rb, int fd);
|
||||
|
||||
static inline void
|
||||
ratbag_set_drv_data(struct ratbag *ratbag, void *drv_data)
|
||||
{
|
||||
ratbag->drv_data = drv_data;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
ratbag_get_drv_data(struct ratbag *ratbag)
|
||||
{
|
||||
return ratbag->drv_data;
|
||||
}
|
||||
|
||||
static inline void
|
||||
ratbag_profile_set_drv_data(struct ratbag_profile *profile, void *drv_data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user