summaryrefslogtreecommitdiff
path: root/include/highlevel.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-08 14:53:30 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-08 14:53:30 +0200
commit3a851dfe87c88ac1d4dddc2a26cc48b037f852f9 (patch)
treea8a8f34291aa58b25737088d247a91a7f60b4fec /include/highlevel.h
parent60064dd0412a149fe00cfc4e2f2361c22656db57 (diff)
Replace direct file I/O with abstraction layer
This should make it easier to use libsquashfs with custom setups that embedd a squashfs image inside something else. Also, it should make it easier to port to non unix-like platforms. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/highlevel.h')
-rw-r--r--include/highlevel.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index ffcc44c..4c560f7 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -17,6 +17,7 @@
#include "sqfs/meta_writer.h"
#include "sqfs/xattr.h"
#include "sqfs/dir.h"
+#include "sqfs/io.h"
#include "data_reader.h"
#include "fstree.h"
@@ -26,9 +27,9 @@
typedef struct {
sqfs_compressor_t *cmp;
data_reader_t *data;
+ sqfs_file_t *file;
sqfs_super_t super;
fstree_t fs;
- int sqfsfd;
} sqfs_reader_t;
enum RDTREE_FLAGS {
@@ -52,7 +53,7 @@ enum RDTREE_FLAGS {
Returns 0 on success. Prints error messages to stderr on failure.
*/
-int sqfs_serialize_fstree(int outfd, sqfs_super_t *super, fstree_t *fs,
+int sqfs_serialize_fstree(sqfs_file_t *file, sqfs_super_t *super, fstree_t *fs,
sqfs_compressor_t *cmp, sqfs_id_table_t *idtbl);
/*
@@ -72,14 +73,14 @@ tree_node_t *tree_node_from_inode(sqfs_inode_generic_t *inode,
Returns 0 on success. Prints error messages to stderr on failure.
*/
int deserialize_fstree(fstree_t *out, sqfs_super_t *super,
- sqfs_compressor_t *cmp, int fd, int flags);
+ sqfs_compressor_t *cmp, sqfs_file_t *file, int flags);
/*
Generate a squahfs xattr table from a file system tree.
Returns 0 on success. Prints error messages to stderr on failure.
*/
-int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
+int write_xattr(sqfs_file_t *file, fstree_t *fs, sqfs_super_t *super,
sqfs_compressor_t *cmp);
/*
@@ -87,7 +88,7 @@ int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
Returns 0 on success. Prints error messages to stderr on failure.
*/
-int write_export_table(int outfd, fstree_t *fs, sqfs_super_t *super,
+int write_export_table(sqfs_file_t *file, fstree_t *fs, sqfs_super_t *super,
sqfs_compressor_t *cmp);
/* Print out fancy statistics for squashfs packing tools */