forked from drath/libratbag
ratbagd: add ratbagd_device_get_path()
Add helper to retrieve the device path from outside of ratbagd-device.c. This will be needed for the non-object-manager based enumerators and signals introduced to org.freedesktop.ratbag1.Manager. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
@@ -221,6 +221,12 @@ struct ratbagd_device *ratbagd_device_free(struct ratbagd_device *device)
|
||||
return mfree(device);
|
||||
}
|
||||
|
||||
const char *ratbagd_device_get_path(struct ratbagd_device *device)
|
||||
{
|
||||
assert(device);
|
||||
return device->path;
|
||||
}
|
||||
|
||||
bool ratbagd_device_linked(struct ratbagd_device *device)
|
||||
{
|
||||
return device && rbnode_linked(&device->node);
|
||||
|
||||
@@ -64,6 +64,8 @@ int ratbagd_device_new(struct ratbagd_device **out,
|
||||
const char *name,
|
||||
struct ratbag_device *lib_device);
|
||||
struct ratbagd_device *ratbagd_device_free(struct ratbagd_device *device);
|
||||
const char *ratbagd_device_get_path(struct ratbagd_device *device);
|
||||
|
||||
bool ratbagd_device_linked(struct ratbagd_device *device);
|
||||
void ratbagd_device_link(struct ratbagd_device *device);
|
||||
void ratbagd_device_unlink(struct ratbagd_device *device);
|
||||
|
||||
Reference in New Issue
Block a user