libudev: hide definition of struct udev_device
This commit is contained in:
parent
56fa3682b9
commit
538bdb48d8
|
@ -4,36 +4,7 @@
|
||||||
#include "libudev.h"
|
#include "libudev.h"
|
||||||
#include "sd-device.h"
|
#include "sd-device.h"
|
||||||
|
|
||||||
#include "libudev-list-internal.h"
|
struct udev_device;
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 *udev_device_new(struct udev *udev, sd_device *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);
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "device-private.h"
|
#include "device-private.h"
|
||||||
#include "device-util.h"
|
#include "device-util.h"
|
||||||
#include "libudev-device-internal.h"
|
#include "libudev-device-internal.h"
|
||||||
|
#include "libudev-list-internal.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
#include "time-util.h"
|
#include "time-util.h"
|
||||||
|
|
||||||
|
@ -36,6 +37,36 @@
|
||||||
* a unique name inside that subsystem.
|
* 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_get_seqnum:
|
||||||
* @udev_device: udev device
|
* @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;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "device-enumerator-private.h"
|
#include "device-enumerator-private.h"
|
||||||
#include "device-util.h"
|
#include "device-util.h"
|
||||||
#include "libudev-device-internal.h"
|
#include "libudev-device-internal.h"
|
||||||
|
#include "libudev-list-internal.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:libudev-enumerate
|
* SECTION:libudev-enumerate
|
||||||
|
@ -333,7 +334,7 @@ _public_ int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumera
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return 0;
|
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)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue