mnt_table_find_srcpath
mnt_table_find_tag
mnt_table_find_target
+mnt_table_first_fs
mnt_table_get_cache
mnt_table_get_intro_comment
mnt_table_get_nents
mnt_table_get_trailing_comment
mnt_table_get_userdata
mnt_table_is_fs_mounted
+mnt_table_last_fs
mnt_table_next_child_fs
mnt_table_next_fs
mnt_table_parse_dir
extern struct libmnt_cache *mnt_table_get_cache(struct libmnt_table *tb);
extern int mnt_table_add_fs(struct libmnt_table *tb, struct libmnt_fs *fs);
extern int mnt_table_remove_fs(struct libmnt_table *tb, struct libmnt_fs *fs);
+extern int mnt_table_first_fs(struct libmnt_table *tb, struct libmnt_fs **fs);
+extern int mnt_table_last_fs(struct libmnt_table *tb, struct libmnt_fs **fs);
extern int mnt_table_next_fs(struct libmnt_table *tb, struct libmnt_iter *itr,
struct libmnt_fs **fs);
extern int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr,
mnt_table_append_intro_comment;
mnt_table_append_trailing_comment;
mnt_table_enable_comments;
+ mnt_table_first_fs;
mnt_table_get_intro_comment;
mnt_table_get_trailing_comment;
mnt_table_get_userdata;
+ mnt_table_last_fs;
mnt_table_replace_file;
mnt_table_set_intro_comment;
mnt_table_set_trailing_comment;
return rc;
}
+/**
+ * mnt_table_first_fs:
+ * @tb: tab pointer
+ * @fs: returns the first tab entry
+ *
+ * Returns: 0 on success, negative number in case of error or 1 at the end of list.
+ */
+int mnt_table_first_fs(struct libmnt_table *tb, struct libmnt_fs **fs)
+{
+ assert(tb);
+ assert(fs);
+
+ if (!tb || !fs)
+ return -EINVAL;
+ if (list_empty(&tb->ents))
+ return 1;
+ *fs = list_first_entry(&tb->ents, struct libmnt_fs, ents);
+ return 0;
+}
+
+/**
+ * mnt_table_last_fs:
+ * @tb: tab pointer
+ * @fs: returns the last tab entry
+ *
+ * Returns: 0 on success, negative number in case of error or 1 at the end of list.
+ */
+int mnt_table_last_fs(struct libmnt_table *tb, struct libmnt_fs **fs)
+{
+ assert(tb);
+ assert(fs);
+
+ if (!tb || !fs)
+ return -EINVAL;
+ if (list_empty(&tb->ents))
+ return 1;
+ *fs = list_last_entry(&tb->ents, struct libmnt_fs, ents);
+ return 0;
+}
+
/**
* mnt_table_find_next_fs:
* @tb: table