summaryrefslogtreecommitdiff
path: root/include/fstree.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-02-18 21:50:36 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-02-18 23:50:46 +0100
commit9e510d4ae6dbad555a3416fbe041f4aa8189cbde (patch)
treec0076c297f7039697c79174879e6d08703ae3bdd /include/fstree.h
parentb3051223fcafc954767058811d279f5b6941a9ba (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/fstree.h')
-rw-r--r--include/fstree.h9
1 files changed, 9 insertions, 0 deletions
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 */