devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4483ef20d33e9207e8791baf8af10b12d37c7753
commit 4483ef20d33e9207e8791baf8af10b12d37c7753 Author: vivek <[email protected]> Date: Fri Sep 26 08:37:20 2014 -0400 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 <[email protected]> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1492 --- src/lib/eeze/Eeze.h | 9 +++++++++ src/lib/eeze/eeze_udev_syspath.c | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/lib/eeze/Eeze.h b/src/lib/eeze/Eeze.h index 186d0c8..d63c544 100644 --- a/src/lib/eeze/Eeze.h +++ b/src/lib/eeze/Eeze.h @@ -548,6 +548,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); /** + * 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. * * @param syspath The /sys/ path with or without the /sys/ diff --git a/src/lib/eeze/eeze_udev_syspath.c b/src/lib/eeze/eeze_udev_syspath.c index 0075f2a..cd4a6e0 100644 --- a/src/lib/eeze/eeze_udev_syspath.c +++ b/src/lib/eeze/eeze_udev_syspath.c @@ -225,6 +225,30 @@ eeze_udev_syspath_set_sysattr(const char *syspath, 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 eeze_udev_syspath_is_mouse(const char *syspath) { --
