+
+const char *udev_device_get_driver(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return NULL;
+ return udev_device->driver;
+}
+
+dev_t udev_device_get_devnum(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return makedev(0, 0);
+ return udev_device->devnum;
+}
+
+const char *udev_device_get_action(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return NULL;
+ return udev_device->action;
+}
+
+unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return 0;
+ return udev_device->seqnum;
+}
+
+int device_set_devpath(struct udev_device *udev_device, const char *devpath)
+{
+ if (asprintf(&udev_device->syspath, "%s%s", udev_get_sys_path(udev_device->udev), devpath) < 0)
+ return -ENOMEM;
+ udev_device->devpath = &udev_device->syspath[strlen(udev_get_sys_path(udev_device->udev))];
+ return 0;
+}
+
+int device_set_subsystem(struct udev_device *udev_device, const char *subsystem)
+{
+ udev_device->subsystem = strdup(subsystem);
+ if (udev_device->subsystem == NULL)
+ return -1;
+ return 0;
+}
+
+int device_set_devname(struct udev_device *udev_device, const char *devname)
+{
+ udev_device->devname = strdup(devname);
+ if (udev_device->devname == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+int device_add_devlink(struct udev_device *udev_device, const char *devlink)
+{
+ if (name_list_add(udev_device->udev, &udev_device->link_list, devlink, 0) == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+int device_add_property(struct udev_device *udev_device, const char *property)
+{
+ if (name_list_add(udev_device->udev, &udev_device->env_list, property, 0) == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+int device_set_action(struct udev_device *udev_device, const char *action)
+{
+ udev_device->action = strdup(action);
+ if (udev_device->action == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+int device_set_driver(struct udev_device *udev_device, const char *driver)
+{
+ udev_device->driver = strdup(driver);
+ if (udev_device->driver == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+const char *device_get_devpath_old(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return NULL;
+ return udev_device->devpath_old;
+}
+
+int device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old)
+{
+ udev_device->devpath_old = strdup(devpath_old);
+ if (udev_device->devpath_old == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+const char *device_get_physdevpath(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return NULL;
+ return udev_device->physdevpath;
+}
+
+int device_set_physdevpath(struct udev_device *udev_device, const char *physdevpath)
+{
+ udev_device->physdevpath = strdup(physdevpath);
+ if (udev_device->physdevpath == NULL)
+ return -ENOMEM;
+ return 0;
+}
+
+int device_get_timeout(struct udev_device *udev_device)
+{
+ if (udev_device == NULL)
+ return -1;
+ return udev_device->timeout;
+}
+
+int device_set_timeout(struct udev_device *udev_device, int timeout)
+{
+ udev_device->timeout = timeout;
+ return 0;
+}
+
+int device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum)
+{
+ udev_device->seqnum = seqnum;
+ return 0;
+}
+
+int device_set_devnum(struct udev_device *udev_device, dev_t devnum)
+{
+ udev_device->devnum = devnum;
+ return 0;
+}