Iterator

Iterator — unified iterator

Synopsis

struct              libscols_iter;
void                scols_free_iter                     (struct libscols_iter *itr);
int                 scols_iter_get_direction            (struct libscols_iter *itr);
struct libscols_iter * scols_new_iter                   (int direction);
void                scols_reset_iter                    (struct libscols_iter *itr,
                                                         int direction);

Description

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

Details

struct libscols_iter

struct libscols_iter;

Generic iterator


scols_free_iter ()

void                scols_free_iter                     (struct libscols_iter *itr);

Deallocates the iterator.

itr :

iterator pointer

scols_iter_get_direction ()

int                 scols_iter_get_direction            (struct libscols_iter *itr);

itr :

iterator pointer

Returns :

SCOLS_INTER_{FOR,BACK}WARD

scols_new_iter ()

struct libscols_iter * scols_new_iter                   (int direction);

direction :

SCOLS_INTER_{FOR,BACK}WARD direction

Returns :

newly allocated generic libmount iterator.

scols_reset_iter ()

void                scols_reset_iter                    (struct libscols_iter *itr,
                                                         int direction);

Resets the iterator.

itr :

iterator pointer

direction :

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