summaryrefslogtreecommitdiff
path: root/include/highlevel.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-05 20:06:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-05 22:39:45 +0200
commit1e24f45ab120ea83a6faab2e4e14038547898f64 (patch)
tree37e263056c462ac53bad36b5c7d72dc7dad7b2d8 /include/highlevel.h
parentad3ca222ab5142769d1c56029360955490f05202 (diff)
Merge all the common code for generating images
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/highlevel.h')
-rw-r--r--include/highlevel.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index 3b91007..44872cf 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -9,6 +9,7 @@
#include "config.h"
+#include "sqfs/xattr_writer.h"
#include "sqfs/compressor.h"
#include "sqfs/id_table.h"
#include "sqfs/inode.h"
@@ -41,6 +42,34 @@ typedef struct {
sqfs_u64 bytes_read;
} data_writer_stats_t;
+typedef struct {
+ sqfs_data_writer_t *data;
+ sqfs_compressor_t *cmp;
+ sqfs_id_table_t *idtbl;
+ sqfs_file_t *outfile;
+ sqfs_super_t super;
+ fstree_t fs;
+ data_writer_stats_t stats;
+ sqfs_xattr_writer_t *xwr;
+} sqfs_writer_t;
+
+typedef struct {
+ const char *filename;
+ char *fs_defaults;
+ char *comp_extra;
+ size_t block_size;
+ size_t devblksize;
+ size_t max_backlog;
+ size_t num_jobs;
+
+ int outmode;
+ E_SQFS_COMPRESSOR comp_id;
+
+ bool exportable;
+ bool no_xattr;
+ bool quiet;
+} sqfs_writer_cfg_t;
+
/*
High level helper function to serialize an entire file system tree to
a squashfs inode table and directory table.
@@ -92,4 +121,12 @@ void register_stat_hooks(sqfs_data_writer_t *data, data_writer_stats_t *stats);
int write_data_from_file(sqfs_data_writer_t *data, sqfs_inode_generic_t *inode,
sqfs_file_t *file, int flags);
+void sqfs_writer_cfg_init(sqfs_writer_cfg_t *cfg);
+
+int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg);
+
+int sqfs_writer_finish(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *cfg);
+
+void sqfs_writer_cleanup(sqfs_writer_t *sqfs);
+
#endif /* HIGHLEVEL_H */