From 307107ecd2fc3ffbf6fe91497daf767700f3572f Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 1 Sep 2019 22:42:49 +0200 Subject: 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 --- lib/sqfs/comp/internal.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'lib/sqfs/comp/internal.h') diff --git a/lib/sqfs/comp/internal.h b/lib/sqfs/comp/internal.h index 19ef5cd..229772f 100644 --- a/lib/sqfs/comp/internal.h +++ b/lib/sqfs/comp/internal.h @@ -16,29 +16,14 @@ int generic_write_options(int fd, const void *data, size_t size); int generic_read_options(int fd, void *data, size_t size); -compressor_t *create_xz_compressor(bool compress, size_t block_size, - char *options); +compressor_t *create_xz_compressor(const compressor_config_t *cfg); -compressor_t *create_gzip_compressor(bool compress, size_t block_size, - char *options); +compressor_t *create_gzip_compressor(const compressor_config_t *cfg); -compressor_t *create_lzo_compressor(bool compress, size_t block_size, - char *options); +compressor_t *create_lzo_compressor(const compressor_config_t *cfg); -compressor_t *create_lz4_compressor(bool compress, size_t block_size, - char *options); +compressor_t *create_lz4_compressor(const compressor_config_t *cfg); -compressor_t *create_zstd_compressor(bool compress, size_t block_size, - char *options); - -void compressor_xz_print_help(void); - -void compressor_gzip_print_help(void); - -void compressor_lzo_print_help(void); - -void compressor_lz4_print_help(void); - -void compressor_zstd_print_help(void); +compressor_t *create_zstd_compressor(const compressor_config_t *cfg); #endif /* INTERNAL_H */ -- cgit v1.2.3