aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/directory.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/directory.h b/src/directory.h
index 14bda5b58..9dd064ef7 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -68,6 +68,20 @@ directory_get_path(struct directory *directory)
return directory->path;
}
+static inline struct directory *
+directory_get_child(const struct directory *directory, const char *name)
+{
+ return dirvec_find(&directory->children, name);
+}
+
+static inline struct directory *
+directory_new_child(struct directory *directory, const char *name)
+{
+ struct directory *subdir = directory_new(name, directory);
+ dirvec_add(&directory->children, subdir);
+ return subdir;
+}
+
void
directory_prune_empty(struct directory *directory);