Welcome to NYCU CSIT Mirror site

Iterator

Iterator

Iterator — unified iterator

Synopsis

struct              libmnt_iter;
void                mnt_free_iter                       (struct libmnt_iter *itr);
int                 mnt_iter_get_direction              (struct libmnt_iter *itr);
struct libmnt_iter * mnt_new_iter                       (int direction);
void                mnt_reset_iter                      (struct libmnt_iter *itr,
                                                         int direction);

Description

The iterator keeps the direction and the last position for access to the internal library tables/lists.

Details

struct libmnt_iter

struct libmnt_iter;

Generic iterator (stores state about lists)


mnt_free_iter ()

void                mnt_free_iter                       (struct libmnt_iter *itr);

Deallocates the iterator.

itr :

iterator pointer

mnt_iter_get_direction ()

int                 mnt_iter_get_direction              (struct libmnt_iter *itr);

itr :

iterator pointer

Returns :

MNT_INTER_{FOR,BACK}WARD

mnt_new_iter ()

struct libmnt_iter * mnt_new_iter                       (int direction);

direction :

MNT_INTER_{FOR,BACK}WARD direction

Returns :

newly allocated generic libmount iterator.

mnt_reset_iter ()

void                mnt_reset_iter                      (struct libmnt_iter *itr,
                                                         int direction);

Resets the iterator.

itr :

iterator pointer

direction :

MNT_INTER_{FOR,BACK}WARD or -1 to keep the direction unchanged