From 9d431639effb4e33169110031a689fd1e9d435cf Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 18 Jul 2023 20:44:01 +0200 Subject: Split recursive directory iterator The recursive part and the filter part are split up, the recursive iterator wrapper is moved into libsquashfs and the libio iterator is modified to use that internally instead of implementig the recursion step. Signed-off-by: David Oberhollenzer --- include/sqfs/io.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/sqfs/io.h b/include/sqfs/io.h index e851ea1..f148502 100644 --- a/include/sqfs/io.h +++ b/include/sqfs/io.h @@ -606,6 +606,23 @@ SQFS_API int sqfs_dir_iterator_create_native(sqfs_dir_iterator_t **out, const char *path, sqfs_u32 flags); +/** + * @brief Construct a recursive directory iterator + * + * @memberof sqfs_dir_iterator_t + * + * The recursive directory iterator automatcally enters sub directories + * and adds the parent path as prefix to the entries. The "." and ".." + * entries are filtered out. + * + * @param out Returns a pointer to a recursive directory iterator + * @param base The root directory iterator used as base + * + * @return Zero on success, an @ref SQFS_ERROR code on failure. + */ +SQFS_API int sqfs_dir_iterator_create_recursive(sqfs_dir_iterator_t **out, + sqfs_dir_iterator_t *base); + #ifdef __cplusplus } #endif -- cgit v1.2.3