summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-10 23:16:34 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-10 23:16:53 +0200
commit576e195ba5476ebf428bac51365d829d713e6907 (patch)
tree1dc5a487ae278cfd9287dbd233a7975489612ffc /include
parent4d2e87b767d1e025699286783c23926ec5eff857 (diff)
cleanup: move tree deserialization to libsqfs.a
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/highlevel.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index e69e337..f61ad0b 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -10,6 +10,14 @@
#include <stdint.h>
#include <stddef.h>
+enum RDTREE_FLAGS {
+ RDTREE_NO_DEVICES = 0x01,
+ RDTREE_NO_SOCKETS = 0x02,
+ RDTREE_NO_FIFO = 0x04,
+ RDTREE_NO_SLINKS = 0x08,
+ RDTREE_NO_EMPTY = 0x10,
+};
+
/*
Convenience function for writing meta data to a SquashFS image
@@ -40,4 +48,23 @@ int sqfs_write_table(int outfd, sqfs_super_t *super, const void *data,
int sqfs_serialize_fstree(int outfd, sqfs_super_t *super, fstree_t *fs,
compressor_t *cmp, id_table_t *idtbl);
+/*
+ Convert a generic squashfs tree node to an fstree_t node.
+
+ Prints error messages to stderr on failure.
+ */
+tree_node_t *tree_node_from_inode(sqfs_inode_generic_t *inode,
+ const id_table_t *idtbl,
+ const char *name,
+ size_t block_size);
+
+/*
+ Restore a file system tree from a squashfs image. The given flags are a
+ combination of RDTREE_FLAGS.
+
+ Returns 0 on success. Prints error messages to stderr on failure.
+ */
+int deserialize_fstree(fstree_t *out, sqfs_super_t *super, compressor_t *cmp,
+ int fd, int flags);
+
#endif /* HIGHLEVEL_H */