From 7d01bbb78c11cb54c96cf9708916a116190364cb Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 14 May 2023 03:37:36 +0200 Subject: 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 --- lib/io/src/win32/dir_iterator.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/io/src/win32') diff --git a/lib/io/src/win32/dir_iterator.c b/lib/io/src/win32/dir_iterator.c index 23d00f4..94fd6e6 100644 --- a/lib/io/src/win32/dir_iterator.c +++ b/lib/io/src/win32/dir_iterator.c @@ -107,6 +107,11 @@ static void dir_iterator_destroy(sqfs_object_t *obj) free(dir); } +static void dir_iterator_ignore_subdir(dir_iterator_t *it) +{ + (void)it; +} + static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out) { const dir_iterator_win32_t *dir = (const dir_iterator_win32_t *)it; @@ -139,6 +144,7 @@ static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out) ((dir_iterator_t *)sub)->next = dir_iterator_next; ((dir_iterator_t *)sub)->read_link = dir_iterator_read_link; ((dir_iterator_t *)sub)->open_subdir = dir_iterator_open_subdir; + ((dir_iterator_t *)sub)->ignore_subdir = dir_iterator_ignore_subdir; sub->is_first = true; sub->state = 0; @@ -198,6 +204,7 @@ dir_iterator_t *dir_iterator_create(const char *path) ((dir_iterator_t *)it)->next = dir_iterator_next; ((dir_iterator_t *)it)->read_link = dir_iterator_read_link; ((dir_iterator_t *)it)->open_subdir = dir_iterator_open_subdir; + ((dir_iterator_t *)it)->ignore_subdir = dir_iterator_ignore_subdir; it->is_first = true; it->state = 0; -- cgit v1.2.3