summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-12-09 15:10:43 -0500
committerChris Michael <cp.michael@samsung.com>2014-12-09 15:10:43 -0500
commit9778443f02e79ae9d843eed69371431ce4898b71 (patch)
treec808d10aad1f6849374ada010f517e02d137036b /src/lib/eeze
parent34f9c6386233c7d139ff87b56ed9a691999e4d87 (diff)
eeze: Add API function for eeze_udev_find_by_subsystem_sysname
Summary: This adds an API function to find a device by subsystem_sysname. This is needed for the port of ecore_drm to use libinput. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/eeze_udev_find.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/eeze/eeze_udev_find.c b/src/lib/eeze/eeze_udev_find.c
index 899a53bcb0..06bbb4c087 100644
--- a/src/lib/eeze/eeze_udev_find.c
+++ b/src/lib/eeze/eeze_udev_find.c
@@ -382,3 +382,31 @@ eeze_udev_find_by_sysattr(const char *sysattr,
382 udev_enumerate_unref(en); 382 udev_enumerate_unref(en);
383 return ret; 383 return ret;
384} 384}
385
386EAPI Eina_List *
387eeze_udev_find_by_subsystem_sysname(const char *subsystem, const char *sysname)
388{
389 _udev_enumerate *en;
390 _udev_list_entry *devs, *cur;
391 _udev_device *device;
392 const char *devname;
393 Eina_List *ret = NULL;
394
395 if (!sysname) return NULL;
396
397 en = udev_enumerate_new(udev);
398 if (!en) return NULL;
399
400 udev_enumerate_scan_devices(en);
401 devs = udev_enumerate_get_list_entry(en);
402 udev_list_entry_foreach(cur, devs)
403 {
404 devname = udev_list_entry_get_name(cur);
405 device =
406 udev_device_new_from_subsystem_sysname(udev, subsystem, sysname);
407 ret = eina_list_append(ret, eina_stringshare_add(devname));
408 udev_device_unref(device);
409 }
410 udev_enumerate_unref(en);
411 return ret;
412}