summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-23 13:16:21 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-23 13:55:38 +0100
commitf92e31c94f953a68309dab7df75f5f9cc67caa7a (patch)
treee3c25f232b44a99d40db49521d1974ddbb67df2c /include/common.h
parent9db873364de85e6b5f972dbd2bada80591ef8af4 (diff)
Add simple sqfs_tree_node_t hardlink detection to libcommon
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index bdb3837..9938ba0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -75,6 +75,12 @@ typedef struct {
bool quiet;
} sqfs_writer_cfg_t;
+typedef struct sqfs_hard_link_t {
+ struct sqfs_hard_link_t *next;
+ sqfs_u32 inode_number;
+ char *target;
+} sqfs_hard_link_t;
+
#define container_of(ptr, type, member) \
((type *)((char *)ptr - offsetof(type, member)))
@@ -132,6 +138,9 @@ void sqfs_writer_cleanup(sqfs_writer_t *sqfs);
void sqfs_perror(const char *file, const char *action, int error_code);
+int sqfs_tree_find_hard_links(const sqfs_tree_node_t *root,
+ sqfs_hard_link_t **out);
+
/*
A wrapper around mkdir() that behaves like 'mkdir -p'. It tries to create
every component of the given path and skips already existing entries.