diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-01 22:42:49 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-01 22:42:49 +0200 |
commit | 307107ecd2fc3ffbf6fe91497daf767700f3572f (patch) | |
tree | 87c2c5993ab10cd4aa791a4e6d34f251db208ed2 /lib/sqfshelper/sqfs_reader.c | |
parent | 2e28c45601a57b1d23e9cad33d2bdcc59e8a3f4f (diff) |
Move command line processing stuff out of compressor code
This commit moves stuff like printing help text, command line option
processing and enumerating available processors on stdout out of
the generic compressor code.
The option string is replaced with a structure that directly exposese
the tweakable parameters for all compressors. A function for parsing
the command line arguments into this structure is added in sqfshelper.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper/sqfs_reader.c')
-rw-r--r-- | lib/sqfshelper/sqfs_reader.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqfshelper/sqfs_reader.c b/lib/sqfshelper/sqfs_reader.c index 197e08f..49e91f5 100644 --- a/lib/sqfshelper/sqfs_reader.c +++ b/lib/sqfshelper/sqfs_reader.c @@ -14,6 +14,8 @@ int sqfs_reader_open(sqfs_reader_t *rd, const char *filename, int rdtree_flags) { + compressor_config_t cfg; + memset(rd, 0, sizeof(*rd)); rd->sqfsfd = open(filename, O_RDONLY); @@ -30,8 +32,11 @@ int sqfs_reader_open(sqfs_reader_t *rd, const char *filename, int rdtree_flags) goto fail_fd; } - rd->cmp = compressor_create(rd->super.compression_id, false, - rd->super.block_size, NULL); + compressor_config_init(&cfg, rd->super.compression_id, + rd->super.block_size, + SQFS_COMP_FLAG_UNCOMPRESS); + + rd->cmp = compressor_create(&cfg); if (rd->cmp == NULL) goto fail_fd; |