From 9e510d4ae6dbad555a3416fbe041f4aa8189cbde Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 18 Feb 2021 21:50:36 +0100 Subject: libfstree: add a subdirectory scanning function So we can scan a sub-directory within a the base directory without having to do string operations first. Signed-off-by: David Oberhollenzer --- include/fstree.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/fstree.h b/include/fstree.h index 193cecb..e5fc966 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -254,4 +254,13 @@ int fstree_resolve_hard_link(fstree_t *fs, tree_node_t *node); int fstree_from_dir(fstree_t *fs, tree_node_t *root, const char *path, unsigned int flags); +/* + Same as fstree_from_dir, but scans a sub-directory inside the specified path. + + Returns 0 on success, prints to stderr on failure. + */ +int fstree_from_subdir(fstree_t *fs, tree_node_t *root, + const char *path, const char *subdir, + unsigned int flags); + #endif /* FSTREE_H */ -- cgit v1.2.3