From 50b67940c793e72656787469ced6e0245bb580b4 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 29 May 2023 20:16:38 +0200 Subject: libfstree: accept dir_entry_t instead of path and struct stat Because the dir_entry_t also has a flag for had links, the regular node and hard-link node interface can be unified. This simplifies the users of libfstree (gensquashfs, tar2sqfs) since we can simply hose the entries from an iterator directly into the tree. Signed-off-by: David Oberhollenzer --- include/fstree.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/fstree.h b/include/fstree.h index 83b7737..55f0928 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -15,6 +15,7 @@ #include #include "sqfs/predef.h" +#include "io/dir_iterator.h" #include "io/istream.h" #include "compat.h" @@ -141,8 +142,8 @@ void fstree_cleanup(fstree_t *fs); This function does not print anything to stderr, instead it sets an appropriate errno value. Internally it uses fstree_mknode to create the node. */ -tree_node_t *fstree_add_generic(fstree_t *fs, const char *path, - const struct stat *sb, const char *extra); +tree_node_t *fstree_add_generic(fstree_t *fs, const dir_entry_t *ent, + const char *extra); /* This function performs all the necessary post processing steps on the file @@ -182,12 +183,6 @@ tree_node_t *fstree_get_node_by_path(fstree_t *fs, tree_node_t *root, const char *path, bool create_implicitly, bool stop_at_parent); -/* - Add a hard link node. Returns NULL on failure and sets errno. - */ -tree_node_t *fstree_add_hard_link(fstree_t *fs, const char *path, - const char *target); - /* Try to resolve all hard links in the tree. -- cgit v1.2.3