]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libudev: hide definition of struct udev_device 12777/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Jun 2019 06:15:06 +0000 (15:15 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Jun 2019 14:59:08 +0000 (23:59 +0900)
src/libudev/libudev-device-internal.h
src/libudev/libudev-device.c
src/libudev/libudev-enumerate.c

index 2be49c98927cd1b11b3120d9e66dc69a71df80d8..cd6c2a5bc57157fd14ecd93f740e1da5f22733c2 100644 (file)
@@ -4,36 +4,7 @@
 #include "libudev.h"
 #include "sd-device.h"
 
-#include "libudev-list-internal.h"
-
-/**
- * udev_device:
- *
- * Opaque object representing one kernel sys device.
- */
-struct udev_device {
-        struct udev *udev;
-
-        /* real device object */
-        sd_device *device;
-
-        /* legacy */
-        unsigned n_ref;
-
-        struct udev_device *parent;
-        bool parent_set;
-
-        struct udev_list *properties;
-        uint64_t properties_generation;
-        struct udev_list *tags;
-        uint64_t tags_generation;
-        struct udev_list *devlinks;
-        uint64_t devlinks_generation;
-        bool properties_read:1;
-        bool tags_read:1;
-        bool devlinks_read:1;
-        struct udev_list *sysattrs;
-        bool sysattrs_read;
-};
+struct udev_device;
 
 struct udev_device *udev_device_new(struct udev *udev, sd_device *device);
+sd_device *udev_device_get_sd_device(struct udev_device *udev_device);
index d3a3c53969728dc2b519e3df2a61fbfb81095b8f..91dc910773c1b4caaf3e6ef6b36bdeb33efb94f9 100644 (file)
@@ -23,6 +23,7 @@
 #include "device-private.h"
 #include "device-util.h"
 #include "libudev-device-internal.h"
+#include "libudev-list-internal.h"
 #include "parse-util.h"
 #include "time-util.h"
 
  * a unique name inside that subsystem.
  */
 
+/**
+ * udev_device:
+ *
+ * Opaque object representing one kernel sys device.
+ */
+struct udev_device {
+        struct udev *udev;
+
+        /* real device object */
+        sd_device *device;
+
+        /* legacy */
+        unsigned n_ref;
+
+        struct udev_device *parent;
+        bool parent_set;
+
+        struct udev_list *properties;
+        uint64_t properties_generation;
+        struct udev_list *tags;
+        uint64_t tags_generation;
+        struct udev_list *devlinks;
+        uint64_t devlinks_generation;
+        bool properties_read:1;
+        bool tags_read:1;
+        bool devlinks_read:1;
+        struct udev_list *sysattrs;
+        bool sysattrs_read;
+};
+
 /**
  * udev_device_get_seqnum:
  * @udev_device: udev device
@@ -834,3 +865,9 @@ _public_ int udev_device_has_tag(struct udev_device *udev_device, const char *ta
 
         return sd_device_has_tag(udev_device->device, tag) > 0;
 }
+
+sd_device *udev_device_get_sd_device(struct udev_device *udev_device) {
+        assert(udev_device);
+
+        return udev_device->device;
+}
index 3b9cf897cdf70f33d6a638cb513f6f21cf2a86a1..a8b3f53572413e967e230076c0ce22233adb27d8 100644 (file)
@@ -17,6 +17,7 @@
 #include "device-enumerator-private.h"
 #include "device-util.h"
 #include "libudev-device-internal.h"
+#include "libudev-list-internal.h"
 
 /**
  * SECTION:libudev-enumerate
@@ -333,7 +334,7 @@ _public_ int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumera
         if (!parent)
                 return 0;
 
-        r = sd_device_enumerator_add_match_parent(udev_enumerate->enumerator, parent->device);
+        r = sd_device_enumerator_add_match_parent(udev_enumerate->enumerator, udev_device_get_sd_device(parent));
         if (r < 0)
                 return r;