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:
David Herrmann
2015-09-29 13:21:27 +02:00
parent 7e4d757bdf
commit 9ac799bc95
2 changed files with 8 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);