diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-05-14 03:37:36 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-05-14 03:38:00 +0200 |
commit | 7d01bbb78c11cb54c96cf9708916a116190364cb (patch) | |
tree | 93ed0294338d3fca7826b1ec9280c56a7ffda66b /include/io | |
parent | 5e96ce975e021551006ebff744c104f20d49741b (diff) |
libio: Move skip function into dir_iterator_t base interface
For regular iterator types, it's a no-op, for the tree iterator,
it skips the sub tree.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/io')
-rw-r--r-- | include/io/dir_iterator.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/io/dir_iterator.h b/include/io/dir_iterator.h index 74027f5..60c3796 100644 --- a/include/io/dir_iterator.h +++ b/include/io/dir_iterator.h @@ -125,6 +125,17 @@ typedef struct dir_iterator_t { */ int (*open_subdir)(struct dir_iterator_t *it, struct dir_iterator_t **out); + + /** + * @brief Skip a sub-hierarchy on a stacked iterator + * + * If an iterator would ordinarily recurse into a sub-directory, + * tell it to skip those entries. On simple, flag iterators like the + * one returned by @ref dir_iterator_create, this has no effect. + * + * @param it A pointer to the iterator itself. + */ + void (*ignore_subdir)(struct dir_iterator_t *it); } dir_iterator_t; enum { @@ -215,16 +226,6 @@ SQFS_INTERNAL dir_iterator_t *dir_tree_iterator_create(const char *path, const dir_tree_cfg_t *cfg); -/** - * @brief Skip a sub-hierarchy on a stacked iterator - * - * For an iterator returned by @ref dir_tree_iterator_create, if the last entry - * was a directory, do not recurse, but instead skip across the netire sub-tree. - * - * @param it A pointer to an iterator returned by @ref dir_tree_iterator_create - */ -SQFS_INTERNAL void dir_tree_iterator_skip(dir_iterator_t *it); - #ifdef __cplusplus } #endif |