diff options
author | Tom Gundersen <teg@jklm.no> | 2015-04-14 16:22:39 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-04-16 16:47:23 +0100 |
commit | 96df036fe3d25525a44f5efdb2fc8560e82e6cfd (patch) | |
tree | 489e9ac2de5ab8b9c1ac418e07ffc69094c91bd3 /src/systemd/sd-device.h | |
parent | aa02962840e10fa7d052760b98a5c092dd0990e1 (diff) | |
download | systemd-96df036fe3d25525a44f5efdb2fc8560e82e6cfd.tar.gz |
sd-device: add device-enumerator library
Diffstat (limited to 'src/systemd/sd-device.h')
-rw-r--r-- | src/systemd/sd-device.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/systemd/sd-device.h b/src/systemd/sd-device.h index d737753f70..5fcd35f1d5 100644 --- a/src/systemd/sd-device.h +++ b/src/systemd/sd-device.h @@ -7,7 +7,7 @@ This file is part of systemd. Copyright 2008-2012 Kay Sievers <kay@vrfy.org> - Copyright 2014 Tom Gundersen <teg@jklm.no> + Copyright 2014-2015 Tom Gundersen <teg@jklm.no> systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -31,6 +31,9 @@ _SD_BEGIN_DECLARATIONS; typedef struct sd_device sd_device; +typedef struct sd_device_enumerator sd_device_enumerator; + +/* device */ sd_device *sd_device_ref(sd_device *device); sd_device *sd_device_unref(sd_device *device); @@ -72,6 +75,27 @@ int sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const ch int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, char *value); +/* device enumerator */ + +int sd_device_enumerator_new(sd_device_enumerator **ret); +sd_device_enumerator *sd_device_enumerator_ref(sd_device_enumerator *enumerator); +sd_device_enumerator *sd_device_enumerator_unref(sd_device_enumerator *enumerator); + +int sd_device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device); + +sd_device *sd_device_enumerator_get_device_first(sd_device_enumerator *enumerator); +sd_device *sd_device_enumerator_get_device_next(sd_device_enumerator *enumerator); +sd_device *sd_device_enumerator_get_subsystem_first(sd_device_enumerator *enumerator); +sd_device *sd_device_enumerator_get_subsystem_next(sd_device_enumerator *enumerator); + +int sd_device_enumerator_add_match_subsystem(sd_device_enumerator *enumerator, const char *subsystem, int match); +int sd_device_enumerator_add_match_sysattr(sd_device_enumerator *enumerator, const char *sysattr, const char *value, int match); +int sd_device_enumerator_add_match_property(sd_device_enumerator *enumerator, const char *property, const char *value); +int sd_device_enumerator_add_match_sysname(sd_device_enumerator *enumerator, const char *sysname); +int sd_device_enumerator_add_match_tag(sd_device_enumerator *enumerator, const char *tag); +int sd_device_enumerator_add_match_parent(sd_device_enumerator *enumerator, sd_device *parent); +int sd_device_enumerator_add_match_is_initialized(sd_device_enumerator *enumerator); + _SD_END_DECLARATIONS; #endif |