forked from enlightenment/efl
eeze: Added API to get sysattr list of a device
Summary: Added eeze_udev_syspath_get_sysattr_list API to get list of sysattr of a device. It returns Eina list containing list of system attributes. Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1492
This commit is contained in:
parent
6850f9bb85
commit
4483ef20d3
|
@ -547,6 +547,15 @@ EAPI Eina_Bool eeze_udev_syspath_check_sysattr(const char *syspath, const char *
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool eeze_udev_syspath_set_sysattr(const char *syspath, const char *sysattr, double value);
|
EAPI Eina_Bool eeze_udev_syspath_set_sysattr(const char *syspath, const char *sysattr, double value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the sysattr list of a device from the /sys/ path.
|
||||||
|
*
|
||||||
|
* @param syspath The /sys/ path with or without the /sys/
|
||||||
|
* @return Eina_list containing list of sysattr for a device or @c NULL on failure
|
||||||
|
* @since 1.12
|
||||||
|
*/
|
||||||
|
EAPI Eina_List *eeze_udev_syspath_get_sysattr_list(const char *syspath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the device is a mouse.
|
* Checks whether the device is a mouse.
|
||||||
*
|
*
|
||||||
|
|
|
@ -225,6 +225,30 @@ eeze_udev_syspath_set_sysattr(const char *syspath,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI Eina_List *
|
||||||
|
eeze_udev_syspath_get_sysattr_list(const char *syspath)
|
||||||
|
{
|
||||||
|
_udev_device *device;
|
||||||
|
_udev_list_entry *devs, *cur;
|
||||||
|
Eina_List *syslist = NULL;
|
||||||
|
|
||||||
|
if (!syspath)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!(device = _new_device(syspath)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
devs = udev_device_get_sysattr_list_entry(device);
|
||||||
|
udev_list_entry_foreach(cur, devs)
|
||||||
|
{
|
||||||
|
syslist = eina_list_append(syslist,
|
||||||
|
eina_stringshare_add(udev_list_entry_get_name(cur)));
|
||||||
|
}
|
||||||
|
|
||||||
|
udev_device_unref(device);
|
||||||
|
return syslist;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
eeze_udev_syspath_is_mouse(const char *syspath)
|
eeze_udev_syspath_is_mouse(const char *syspath)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue