aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-04-29 16:08:38 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-04-30 14:41:42 +0200
commit7a39921d7fff089c87ac183d3c0d6e42e5cbaa04 (patch)
tree723bce4ebe163fc939919bd877c2919f48d84534 /include
parent4390eddccfb3918291e7b8e4d708411f9b828c04 (diff)
Move the pattern matching from gensquashfs to dir_tree_iterator_t
A simple unit test is added that mainly checks for the behavior of recursing into a sub-tree and only matching the children at the end, but not reporting the parents that don't match. The behavior is inteded to immitate the `find` command. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/util/dir_tree_iterator.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/util/dir_tree_iterator.h b/include/util/dir_tree_iterator.h
index b5ebe90..204f609 100644
--- a/include/util/dir_tree_iterator.h
+++ b/include/util/dir_tree_iterator.h
@@ -25,6 +25,7 @@ enum {
DIR_SCAN_ONE_FILESYSTEM = 0x1000,
DIR_SCAN_NO_RECURSION = 0x2000,
+ DIR_SCAN_MATCH_FULL_PATH = 0x4000,
};
typedef struct {
@@ -34,6 +35,7 @@ typedef struct {
sqfs_u32 def_mode;
sqfs_s64 def_mtime;
const char *prefix;
+ const char *name_pattern;
} dir_tree_cfg_t;
dir_iterator_t *dir_tree_iterator_create(const char *path,