summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorvivek <vivek.ellur@samsung.com>2014-09-26 08:37:20 -0400
committerChris Michael <cp.michael@samsung.com>2014-09-26 08:38:36 -0400
commit4483ef20d33e9207e8791baf8af10b12d37c7753 (patch)
tree6195eff74e7336ff098f4ed91583b89ff6bcd443 /src/lib/eeze
parent6850f9bb859698de88094b29d9b9d0354c12b890 (diff)
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
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/Eeze.h9
-rw-r--r--src/lib/eeze/eeze_udev_syspath.c24
2 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/eeze/Eeze.h b/src/lib/eeze/Eeze.h
index 186d0c87d4..d63c54413f 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 *
548EAPI Eina_Bool eeze_udev_syspath_set_sysattr(const char *syspath, const char *sysattr, double value); 548EAPI Eina_Bool eeze_udev_syspath_set_sysattr(const char *syspath, const char *sysattr, double value);
549 549
550/** 550/**
551 * Get the sysattr list of a device from the /sys/ path.
552 *
553 * @param syspath The /sys/ path with or without the /sys/
554 * @return Eina_list containing list of sysattr for a device or @c NULL on failure
555 * @since 1.12
556 */
557EAPI Eina_List *eeze_udev_syspath_get_sysattr_list(const char *syspath);
558
559/**
551 * Checks whether the device is a mouse. 560 * Checks whether the device is a mouse.
552 * 561 *
553 * @param syspath The /sys/ path with or without the /sys/ 562 * @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 0075f2a279..cd4a6e0778 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,
225 return ret; 225 return ret;
226} 226}
227 227
228EAPI Eina_List *
229eeze_udev_syspath_get_sysattr_list(const char *syspath)
230{
231 _udev_device *device;
232 _udev_list_entry *devs, *cur;
233 Eina_List *syslist = NULL;
234
235 if (!syspath)
236 return NULL;
237
238 if (!(device = _new_device(syspath)))
239 return NULL;
240
241 devs = udev_device_get_sysattr_list_entry(device);
242 udev_list_entry_foreach(cur, devs)
243 {
244 syslist = eina_list_append(syslist,
245 eina_stringshare_add(udev_list_entry_get_name(cur)));
246 }
247
248 udev_device_unref(device);
249 return syslist;
250}
251
228EAPI Eina_Bool 252EAPI Eina_Bool
229eeze_udev_syspath_is_mouse(const char *syspath) 253eeze_udev_syspath_is_mouse(const char *syspath)
230{ 254{