chiark / gitweb /
libudev: pass udev_device in enumerate
[elogind.git] / udev / lib / test-libudev.c
index 4dcc80a141c666c2e446f44cb451c44840eab7be..50123f6ec7eb38613c53ec945a6e4ef5d5480f28 100644 (file)
@@ -56,6 +56,8 @@ static void print_device(struct udev_device *device)
        int count;
 
        printf("*** device: %p ***\n", device);
+       str = udev_device_get_action(device);
+       printf("action:    '%s'\n", str);
        str = udev_device_get_syspath(device);
        printf("syspath:   '%s'\n", str);
        str = udev_device_get_devpath(device);
@@ -114,11 +116,12 @@ static int test_device_parents(struct udev *udev, const char *syspath)
        return 0;
 }
 
-static int devices_enum_cb(struct udev *udev,
-                          const char *devpath, const char *subsystem, const char *name,
-                          void *data)
+static int devices_enum_cb(struct udev_device *device, void *data)
 {
-       printf("device:    '%s' (%s) '%s'\n", devpath, subsystem, name);
+       printf("device:    '%s' (%s) '%s'\n",
+              udev_device_get_syspath(device),
+              udev_device_get_subsystem(device),
+              udev_device_get_sysname(device));
        return 0;
 }