![]() |
![]() |
![]() |
libudev Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
struct udev_enumerate; struct udev_enumerate * udev_enumerate_ref (struct udev_enumerate *udev_enumerate
); struct udev_enumerate * udev_enumerate_unref (struct udev_enumerate *udev_enumerate
); struct udev * udev_enumerate_get_udev (struct udev_enumerate *udev_enumerate
); struct udev_enumerate * udev_enumerate_new (struct udev *udev
); int udev_enumerate_add_match_subsystem (struct udev_enumerate *udev_enumerate
,const char *subsystem
); int udev_enumerate_add_nomatch_subsystem (struct udev_enumerate *udev_enumerate
,const char *subsystem
); int udev_enumerate_add_match_sysattr (struct udev_enumerate *udev_enumerate
,const char *sysattr
,const char *value
); int udev_enumerate_add_nomatch_sysattr (struct udev_enumerate *udev_enumerate
,const char *sysattr
,const char *value
); int udev_enumerate_add_match_property (struct udev_enumerate *udev_enumerate
,const char *property
,const char *value
); int udev_enumerate_add_match_tag (struct udev_enumerate *udev_enumerate
,const char *tag
); int udev_enumerate_add_match_parent (struct udev_enumerate *udev_enumerate
,struct udev_device *parent
); int udev_enumerate_add_match_is_initialized (struct udev_enumerate *udev_enumerate
); int udev_enumerate_add_match_sysname (struct udev_enumerate *udev_enumerate
,const char *sysname
); int udev_enumerate_add_syspath (struct udev_enumerate *udev_enumerate
,const char *syspath
); int udev_enumerate_scan_devices (struct udev_enumerate *udev_enumerate
); int udev_enumerate_scan_subsystems (struct udev_enumerate *udev_enumerate
); struct udev_list_entry * udev_enumerate_get_list_entry (struct udev_enumerate *udev_enumerate
);
Lookup devices in the sys filesystem, filter devices by properties, and return a sorted list of devices.
struct udev_enumerate;
Opaque object representing one device lookup/sort context.
struct udev_enumerate * udev_enumerate_ref (struct udev_enumerate *udev_enumerate
);
Take a reference of a enumeration context.
|
context |
Returns : |
the passed enumeration context |
struct udev_enumerate * udev_enumerate_unref (struct udev_enumerate *udev_enumerate
);
Drop a reference of an enumeration context. If the refcount reaches zero, all resources of the enumeration context will be released.
|
context |
Returns : |
the passed enumeration context if it has still an active reference, or NULL otherwise. |
struct udev * udev_enumerate_get_udev (struct udev_enumerate *udev_enumerate
);
Get the udev library context.
|
context |
Returns : |
a pointer to the context. |
struct udev_enumerate * udev_enumerate_new (struct udev *udev
);
Create an enumeration context to scan /sys.
|
udev library context |
Returns : |
an enumeration context. |
int udev_enumerate_add_match_subsystem (struct udev_enumerate *udev_enumerate
,const char *subsystem
);
Match only devices belonging to a certain kernel subsystem.
|
context |
|
filter for a subsystem of the device to include in the list |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_nomatch_subsystem (struct udev_enumerate *udev_enumerate
,const char *subsystem
);
Match only devices not belonging to a certain kernel subsystem.
|
context |
|
filter for a subsystem of the device to exclude from the list |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_match_sysattr (struct udev_enumerate *udev_enumerate
,const char *sysattr
,const char *value
);
Match only devices with a certain /sys device attribute.
|
context |
|
filter for a sys attribute at the device to include in the list |
|
optional value of the sys attribute |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_nomatch_sysattr (struct udev_enumerate *udev_enumerate
,const char *sysattr
,const char *value
);
Match only devices not having a certain /sys device attribute.
|
context |
|
filter for a sys attribute at the device to exclude from the list |
|
optional value of the sys attribute |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_match_property (struct udev_enumerate *udev_enumerate
,const char *property
,const char *value
);
Match only devices with a certain property.
|
context |
|
filter for a property of the device to include in the list |
|
value of the property |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_match_tag (struct udev_enumerate *udev_enumerate
,const char *tag
);
Match only devices with a certain tag.
|
context |
|
filter for a tag of the device to include in the list |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_match_parent (struct udev_enumerate *udev_enumerate
,struct udev_device *parent
);
Return the devices on the subtree of one given device. The parent itself is included in the list.
A reference for the device is held until the udev_enumerate context is cleaned up.
|
context |
|
parent device where to start searching |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_match_is_initialized
(struct udev_enumerate *udev_enumerate
);
Match only devices which udev has set up already. This makes sure, that the device node permissions and context are properly set and that network devices are fully renamed.
Usually, devices which are found in the kernel but not already handled by udev, have still pending events. Services should subscribe to monitor events and wait for these devices to become ready, instead of using uninitialized devices.
For now, this will not affect devices which do not have a device node and are not network interfaces.
|
context |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_match_sysname (struct udev_enumerate *udev_enumerate
,const char *sysname
);
Match only devices with a given /sys device name.
|
context |
|
filter for the name of the device to include in the list |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_add_syspath (struct udev_enumerate *udev_enumerate
,const char *syspath
);
Add a device to the list of devices, to retrieve it back sorted in dependency order.
|
context |
|
path of a device |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_scan_devices (struct udev_enumerate *udev_enumerate
);
Scan /sys for all devices which match the given filters. No matches will return all currently available devices.
|
udev enumeration context |
Returns : |
0 on success, otherwise a negative error value. |
int udev_enumerate_scan_subsystems (struct udev_enumerate *udev_enumerate
);
Scan /sys for all kernel subsystems, including buses, classes, drivers.
|
udev enumeration context |
Returns : |
0 on success, otherwise a negative error value. |
struct udev_list_entry * udev_enumerate_get_list_entry (struct udev_enumerate *udev_enumerate
);
Get the first entry of the sorted list of device paths.
|
context |
Returns : |
a udev_list_entry. |