/**
* mnt_reset_iter:
* @itr: iterator pointer
- * @direction: MNT_INTER_{FOR,BACK}WARD iterator direction
+ * @direction: MNT_INTER_{FOR,BACK}WARD or -1 to keep the derection unchanged
*
* Resets iterator.
*/
{
assert(itr);
+ if (direction == -1)
+ direction = itr->direction;
+
if (itr) {
memset(itr, 0, sizeof(struct _mnt_iter));
itr->direction = direction;
}
}
+
+/**
+ * mnt_iter_get_direction:
+ * @itr: iterator pointer
+ *
+ * Returns: MNT_INTER_{FOR,BACK}WARD or -1 in case of error.
+ */
+int mnt_iter_get_direction(mnt_iter *itr)
+{
+ assert(itr);
+ return itr ? itr->direction : -1;
+}
extern mnt_iter *mnt_new_iter(int direction);
extern void mnt_free_iter(mnt_iter *mi);
extern void mnt_reset_iter(mnt_iter *mi, int direction);
+extern int mnt_iter_get_direction(mnt_iter *itr);
/* optmap.c */
enum {