diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-10 16:36:12 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-12 20:41:34 +0200 |
commit | 72674fc880fa3a5e121e07f9dcdf6f79437a3011 (patch) | |
tree | bceed63ef051bffc68808ffd19df03ab17085a2e /include/util | |
parent | 58c9982e75c1b23b9c3ff9aad8295035866a67f0 (diff) |
Split out Windows directory iteration code to a dir_iterator_t type
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/util')
-rw-r--r-- | include/util/dir_iterator.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/util/dir_iterator.h b/include/util/dir_iterator.h new file mode 100644 index 0000000..66c13f3 --- /dev/null +++ b/include/util/dir_iterator.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: LGPL-3.0-or-later */ +/* + * dir_iterator.h + * + * Copyright (C) 2023 David Oberhollenzer <goliath@infraroot.at> + */ +#ifndef UTIL_DIR_ITERATOR_H +#define UTIL_DIR_ITERATOR_H + +#include "sqfs/predef.h" + +typedef struct { + sqfs_s64 mtime; + sqfs_u64 dev; + sqfs_u64 rdev; + sqfs_u32 uid; + sqfs_u32 gid; + sqfs_u16 mode; + + char name[]; +} dir_entry_t; + +typedef struct dir_iterator_t { + sqfs_object_t obj; + + int (*next)(struct dir_iterator_t *it, + dir_entry_t **out); +} dir_iterator_t; + +dir_iterator_t *dir_iterator_create(const char *path); + +#endif /* UTIL_DIR_ITERATOR_H */ |