aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-19 18:43:10 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-19 18:43:10 +0200
commita4d371f85ff05c99ce20b7ec49df15cfec11d915 (patch)
treec418e48786ed895db8bcfa235f39254ffa33fa53 /include
parentb94825c4d4371477a3a62cab42038d2a436897c9 (diff)
libsqfs: Add a helper function for turning an inode into a dir entry
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/sqfs/inode.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/sqfs/inode.h b/include/sqfs/inode.h
index 7f4e7b5..ba9c227 100644
--- a/include/sqfs/inode.h
+++ b/include/sqfs/inode.h
@@ -741,6 +741,23 @@ int sqfs_inode_unpack_dir_index_entry(const sqfs_inode_generic_t *inode,
sqfs_dir_index_t **out,
size_t index);
+/**
+ * @brief Create a directory entry from an inode
+ *
+ * @param name The file name or path to store in the directory entry
+ * @param len The lengh of the file name, or 0 to use strlen internally
+ * @param inode The inode from which to use the data
+ * @param idtbl An ID table to use for resolving the inodes uid & gid
+ * @param out Returns a pointer to a @ref sqfs_dir_entry_t on success
+ *
+ * @return Zero on success, a negative @ref SQFS_ERROR value on failure
+ */
+SQFS_API
+int sqfs_dir_entry_from_inode(const char *name, size_t len,
+ const sqfs_inode_generic_t *inode,
+ const sqfs_id_table_t *idtbl,
+ sqfs_dir_entry_t **out);
+
#ifdef __cplusplus
}
#endif