From efa204aedf3578d193b2832b42cf365c7aee48f9 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 15 Dec 2020 11:07:12 +0100 Subject: libfstree: make the directory scanning code a little more generic - Instead of using the fstree root, let the caller specify it. - Add a flag to prevent recursion into sub directories. Signed-off-by: David Oberhollenzer --- include/fstree.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fstree.h b/include/fstree.h index ac92daa..f6ff75f 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -21,6 +21,8 @@ enum { DIR_SCAN_KEEP_TIME = 0x01, DIR_SCAN_ONE_FILESYSTEM = 0x02, + + DIR_SCAN_NO_RECURSION = 0x04, }; #define FSTREE_MODE_HARD_LINK (0) @@ -241,6 +243,7 @@ int fstree_resolve_hard_link(fstree_t *fs, tree_node_t *node); Returns 0 on success, prints to stderr on failure. */ -int fstree_from_dir(fstree_t *fs, const char *path, unsigned int flags); +int fstree_from_dir(fstree_t *fs, tree_node_t *root, + const char *path, unsigned int flags); #endif /* FSTREE_H */ -- cgit v1.2.3