Search and iterate

Search and iterate — search devices and iterate over devices in the cache.

Synopsis

typedef             blkid_dev;
const char *        blkid_dev_devname                   (blkid_dev dev);
int                 blkid_dev_has_tag                   (blkid_dev dev,
                                                         const char *type,
                                                         const char *value);
typedef             blkid_dev_iterate;
blkid_dev_iterate   blkid_dev_iterate_begin             (blkid_cache cache);
void                blkid_dev_iterate_end               (blkid_dev_iterate iterate);
int                 blkid_dev_next                      (blkid_dev_iterate iterate,
                                                         blkid_dev *dev);
int                 blkid_dev_set_search                (blkid_dev_iterate iter,
                                                         char *search_type,
                                                         char *search_value);
blkid_dev           blkid_find_dev_with_tag             (blkid_cache cache,
                                                         const char *type,
                                                         const char *value);
blkid_dev           blkid_get_dev                       (blkid_cache cache,
                                                         const char *devname,
                                                         int flags);
char *              blkid_get_devname                   (blkid_cache cache,
                                                         const char *token,
                                                         const char *value);
char *              blkid_get_tag_value                 (blkid_cache cache,
                                                         const char *tagname,
                                                         const char *devname);
typedef             blkid_tag_iterate;
blkid_tag_iterate   blkid_tag_iterate_begin             (blkid_dev dev);
void                blkid_tag_iterate_end               (blkid_tag_iterate iterate);
int                 blkid_tag_next                      (blkid_tag_iterate iterate,
                                                         const char **type,
                                                         const char **value);

Description

Note that high-level probing API provides information about superblocks (filesystems/raids) only. For partitions and topology is necessary to use the low-level API.

Details

blkid_dev

typedef struct blkid_struct_dev *blkid_dev;

The device object keeps information about one device


blkid_dev_devname ()

const char *        blkid_dev_devname                   (blkid_dev dev);

blkid_dev_has_tag ()

int                 blkid_dev_has_tag                   (blkid_dev dev,
                                                         const char *type,
                                                         const char *value);

blkid_dev_iterate

typedef struct blkid_struct_dev_iterate *blkid_dev_iterate;

devices iterator for high-level (blkid_cache) API


blkid_dev_iterate_begin ()

blkid_dev_iterate   blkid_dev_iterate_begin             (blkid_cache cache);

blkid_dev_iterate_end ()

void                blkid_dev_iterate_end               (blkid_dev_iterate iterate);

blkid_dev_next ()

int                 blkid_dev_next                      (blkid_dev_iterate iterate,
                                                         blkid_dev *dev);

blkid_dev_set_search ()

int                 blkid_dev_set_search                (blkid_dev_iterate iter,
                                                         char *search_type,
                                                         char *search_value);

blkid_find_dev_with_tag ()

blkid_dev           blkid_find_dev_with_tag             (blkid_cache cache,
                                                         const char *type,
                                                         const char *value);

blkid_get_dev ()

blkid_dev           blkid_get_dev                       (blkid_cache cache,
                                                         const char *devname,
                                                         int flags);

blkid_get_devname ()

char *              blkid_get_devname                   (blkid_cache cache,
                                                         const char *token,
                                                         const char *value);

blkid_get_tag_value ()

char *              blkid_get_tag_value                 (blkid_cache cache,
                                                         const char *tagname,
                                                         const char *devname);

blkid_tag_iterate

typedef struct blkid_struct_tag_iterate *blkid_tag_iterate;

tags iterator for high-level (blkid_cache) API


blkid_tag_iterate_begin ()

blkid_tag_iterate   blkid_tag_iterate_begin             (blkid_dev dev);

blkid_tag_iterate_end ()

void                blkid_tag_iterate_end               (blkid_tag_iterate iterate);

blkid_tag_next ()

int                 blkid_tag_next                      (blkid_tag_iterate iterate,
                                                         const char **type,
                                                         const char **value);