summaryrefslogtreecommitdiff
path: root/udev/lib
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-01-06 00:26:28 +0100
committerKay Sievers <kay.sievers@vrfy.org>2009-01-06 00:26:28 +0100
commit3d7b2831cd661afd7d946791110b6ad5a7156d7f (patch)
tree60cb3d1c1216c8a9a42c3c479c1ce4dabd13d393 /udev/lib
parent34ac42b98d75c401520b9f69ff29b6832b6ab668 (diff)
libudev: device - add udev_device_get_property_value()
Diffstat (limited to 'udev/lib')
-rw-r--r--udev/lib/exported_symbols1
-rw-r--r--udev/lib/libudev-device.c14
-rw-r--r--udev/lib/libudev.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/udev/lib/exported_symbols b/udev/lib/exported_symbols
index abf5051791..86ab1059fe 100644
--- a/udev/lib/exported_symbols
+++ b/udev/lib/exported_symbols
@@ -29,6 +29,7 @@ udev_device_get_subsystem
udev_device_get_devtype
udev_device_get_devlinks_list_entry
udev_device_get_properties_list_entry
+udev_device_get_properties_value
udev_device_get_action
udev_device_get_driver
udev_device_get_devnum
diff --git a/udev/lib/libudev-device.c b/udev/lib/libudev-device.c
index 0cb5921281..a7722b3f6e 100644
--- a/udev/lib/libudev-device.c
+++ b/udev/lib/libudev-device.c
@@ -1059,6 +1059,20 @@ struct udev_list_entry *udev_device_add_property_from_string(struct udev_device
return udev_device_add_property(udev_device, name, val);
}
+const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key)
+{
+ struct udev_list_entry *list_entry;
+
+ if (udev_device == NULL)
+ return NULL;
+ if (key == NULL)
+ return NULL;
+
+ list_entry = udev_device_get_properties_list_entry(udev_device);
+ list_entry = udev_list_entry_get_by_name(list_entry, key);
+ return udev_list_entry_get_value(list_entry);
+}
+
#define ENVP_SIZE 128
#define MONITOR_BUF_SIZE 4096
static int update_envp_monitor_buf(struct udev_device *udev_device)
diff --git a/udev/lib/libudev.h b/udev/lib/libudev.h
index 6d6618a9ec..58d7ef98c4 100644
--- a/udev/lib/libudev.h
+++ b/udev/lib/libudev.h
@@ -75,6 +75,7 @@ extern const char *udev_device_get_sysnum(struct udev_device *udev_device);
extern const char *udev_device_get_devnode(struct udev_device *udev_device);
extern struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device);
extern struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device);
+extern const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key);
extern const char *udev_device_get_driver(struct udev_device *udev_device);
extern dev_t udev_device_get_devnum(struct udev_device *udev_device);
extern const char *udev_device_get_action(struct udev_device *udev_device);