From 7a39921d7fff089c87ac183d3c0d6e42e5cbaa04 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 29 Apr 2023 16:08:38 +0200 Subject: 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 --- include/util/dir_tree_iterator.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/util') 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, -- cgit v1.2.3