summaryrefslogtreecommitdiff
path: root/mkfs/mkfs.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-11 02:17:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-11 02:19:01 +0200
commite7ddca51274e88b68aa8eeec8ebd4be48eca3934 (patch)
tree3492eb308c54257bfa8501bb0a56e2170a9f50c4 /mkfs/mkfs.h
parent8825f5973740ae2baaab4d61ac16bc870873c167 (diff)
Encapsulate data/fragment processing in data_writer_t data structure
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/mkfs.h')
-rw-r--r--mkfs/mkfs.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h
index fe4123b..63bfc10 100644
--- a/mkfs/mkfs.h
+++ b/mkfs/mkfs.h
@@ -35,19 +35,13 @@ typedef struct {
char *comp_extra;
} options_t;
+typedef struct data_writer_t data_writer_t;
+
typedef struct {
int outfd;
options_t opt;
sqfs_super_t super;
fstree_t fs;
- void *block;
- void *fragment;
- void *scratch;
-
- sqfs_fragment_t *fragments;
- size_t num_fragments;
- size_t max_fragments;
- size_t frag_offset;
id_table_t idtbl;
@@ -56,8 +50,19 @@ typedef struct {
void process_command_line(options_t *opt, int argc, char **argv);
-int write_data_to_image(sqfs_info_t *info);
-
int write_xattr(sqfs_info_t *info);
+data_writer_t *data_writer_create(sqfs_super_t *super, compressor_t *cmp,
+ int outfd);
+
+void data_writer_destroy(data_writer_t *data);
+
+int data_writer_write_fragment_table(data_writer_t *data);
+
+int write_data_from_fd(data_writer_t *data, file_info_t *fi, int infd);
+
+int data_writer_flush_fragments(data_writer_t *data);
+
+int write_data_to_image(data_writer_t *data, sqfs_info_t *info);
+
#endif /* MKFS_H */