+ printf("link: '%s'\n", value);
+ return 0;
+}
+
+static int print_properties_cb(struct udev_device *udev_device, const char *key, const char *value, void *data)
+{
+ printf("property: '%s=%s'\n", key, value);
+ return 0;
+}
+
+static void print_device(struct udev_device *device)
+{
+ const char *str;
+ int count;
+
+ printf("*** device: %p ***\n", device);
+ str = udev_device_get_devpath(device);
+ printf("devpath: '%s'\n", str);
+ str = udev_device_get_subsystem(device);
+ printf("subsystem: '%s'\n", str);
+ str = udev_device_get_devname(device);
+ printf("devname: '%s'\n", str);
+ count = udev_device_get_devlinks(device, print_devlinks_cb, NULL);
+ printf("found %i links\n", count);
+ count = udev_device_get_properties(device, print_properties_cb, NULL);
+ printf("found %i properties\n", count);
+ printf("\n");
+}
+
+static int test_device(struct udev *udev, const char *devpath)
+{
+ struct udev_device *device;
+
+ printf("looking at device: %s\n", devpath);
+ device = udev_device_new_from_devpath(udev, devpath);
+ if (device == NULL) {
+ printf("no device\n");
+ return -1;
+ }
+ print_device(device);
+ udev_device_unref(device);