eeze: Add code for eeze_udev_syspath_get_sysnum function

Summary: This adds an API function to return the sysnum of a device
based on syspath. This is needed in ecore-drm to return the id
(sysnum) of a drm device.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-09-23 12:59:54 -04:00
parent 34ba873497
commit 25c3570294
1 changed files with 21 additions and 0 deletions

View File

@ -314,3 +314,24 @@ eeze_udev_devpath_get_syspath(const char *devpath)
udev_enumerate_unref(en);
return ret;
}
EAPI int
eeze_udev_syspath_get_sysnum(const char *syspath)
{
_udev_device *device;
const char *test;
int ret = -1;
if (!syspath)
return NULL;
if (!(device = _new_device(syspath)))
return NULL;
if ((test = udev_device_get_sysnum(device)))
ret = atoi(test);
udev_device_unref(device);
return ret;
}