summaryrefslogtreecommitdiff
path: root/udev/lib/libudev.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-09-24 21:39:29 -0700
committerKay Sievers <kay.sievers@vrfy.org>2008-09-24 21:39:29 -0700
commitc8e32461ccc2227da53f98ccd11bcb50d70929bd (patch)
treedf812dc9c5b34d524ad908b5c5705d9aa66e203e /udev/lib/libudev.c
parent03198b93038d3ea87d1699a1e982c235ff824275 (diff)
libudev: add userdata pointer
Diffstat (limited to 'udev/lib/libudev.c')
-rw-r--r--udev/lib/libudev.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/udev/lib/libudev.c b/udev/lib/libudev.c
index 2d34925912..3ff6cabbb0 100644
--- a/udev/lib/libudev.c
+++ b/udev/lib/libudev.c
@@ -37,6 +37,7 @@ struct udev {
void (*log_fn)(struct udev *udev,
int priority, const char *file, int line, const char *fn,
const char *format, va_list args);
+ void *userdata;
char *sys_path;
char *dev_path;
char *rules_path;
@@ -89,6 +90,20 @@ static void selinux_init(struct udev *udev)
#endif
}
+void *udev_get_userdata(struct udev *udev)
+{
+ if (udev == NULL)
+ return NULL;
+ return udev->userdata;
+}
+
+void udev_set_userdata(struct udev *udev, void *userdata)
+{
+ if (udev == NULL)
+ return;
+ udev->userdata = userdata;
+}
+
static void selinux_exit(struct udev *udev)
{
#ifdef USE_SELINUX