20 #ifndef SQFS_COMPRESSOR_H 21 #define SQFS_COMPRESSOR_H 93 sqfs_u32 size, sqfs_u8 *out, sqfs_u32 outsize);
232 SQFS_COMP_FLAG_LZ4_ALL = 0x0001,
243 SQFS_COMP_FLAG_LZMA_ALL = 0x0001,
280 SQFS_COMP_FLAG_XZ_ALL = 0x013F,
306 SQFS_COMP_FLAG_GZIP_ALL = 0x001F,
313 SQFS_COMP_FLAG_GENERIC_ALL = 0x8000,
329 #define SQFS_GZIP_DEFAULT_LEVEL (9) 330 #define SQFS_GZIP_DEFAULT_WINDOW (15) 332 #define SQFS_LZO_DEFAULT_ALG SQFS_LZO1X_999 333 #define SQFS_LZO_DEFAULT_LEVEL (8) 335 #define SQFS_ZSTD_DEFAULT_LEVEL (15) 337 #define SQFS_GZIP_MIN_LEVEL (1) 338 #define SQFS_GZIP_MAX_LEVEL (9) 340 #define SQFS_LZO_MIN_LEVEL (0) 341 #define SQFS_LZO_MAX_LEVEL (9) 343 #define SQFS_ZSTD_MIN_LEVEL (1) 344 #define SQFS_ZSTD_MAX_LEVEL (22) 346 #define SQFS_GZIP_MIN_WINDOW (8) 347 #define SQFS_GZIP_MAX_WINDOW (15) 349 #define SQFS_XZ_MIN_LEVEL (0) 350 #define SQFS_XZ_MAX_LEVEL (9) 351 #define SQFS_XZ_DEFAULT_LEVEL (6) 353 #define SQFS_XZ_MIN_LC 0 354 #define SQFS_XZ_MAX_LC 4 355 #define SQFS_XZ_DEFAULT_LC 3 357 #define SQFS_XZ_MIN_LP 0 358 #define SQFS_XZ_MAX_LP 4 359 #define SQFS_XZ_DEFAULT_LP 0 361 #define SQFS_XZ_MIN_PB 0 362 #define SQFS_XZ_MAX_PB 4 363 #define SQFS_XZ_DEFAULT_PB 2 365 #define SQFS_LZMA_MIN_LEVEL (0) 366 #define SQFS_LZMA_MAX_LEVEL (9) 367 #define SQFS_LZMA_DEFAULT_LEVEL (5) 369 #define SQFS_LZMA_MIN_LC 0 370 #define SQFS_LZMA_MAX_LC 4 371 #define SQFS_LZMA_DEFAULT_LC 3 373 #define SQFS_LZMA_MIN_LP 0 374 #define SQFS_LZMA_MAX_LP 4 375 #define SQFS_LZMA_DEFAULT_LP 0 377 #define SQFS_LZMA_MIN_PB 0 378 #define SQFS_LZMA_MAX_PB 4 379 #define SQFS_LZMA_DEFAULT_PB 2 381 #define SQFS_LZMA_MIN_DICT_SIZE SQFS_META_BLOCK_SIZE 382 #define SQFS_LZMA_MAX_DICT_SIZE SQFS_MAX_BLOCK_SIZE 384 #define SQFS_XZ_MIN_DICT_SIZE SQFS_META_BLOCK_SIZE 385 #define SQFS_XZ_MAX_DICT_SIZE SQFS_MAX_BLOCK_SIZE 407 size_t block_size, sqfs_u16 flags);
Configuration parameters for instantiating a compressor backend.
sqfs_u32 level
Compression level.
Encapsultes a compressor with a simple interface to compress or extract chunks of data...
For XZ, set this to select the PowerPC BCJ filter.
For zlib deflate, set this to try the "filtered" strategy.
struct sqfs_compressor_config_t::@0::@2 lzo
Options for the lzo compressor.
sqfs_u16 flags
A combination of SQFS_COMP_FLAG flags.
Tell the LZMAv1 compressor to try the "extreme" option.
sqfs_u8 lc
Number of literal context bits.
Abstracts file I/O to make it easy to embedd SquashFS.
sqfs_u8 pb
Number of position bits.
SQFS_LZO_ALGORITHM
The available LZO algorithms.
sqfs_u16 id
An SQFS_COMPRESSOR identifier.
sqfs_s32(* do_block)(sqfs_compressor_t *cmp, const sqfs_u8 *in, sqfs_u32 size, sqfs_u8 *out, sqfs_u32 outsize)
Compress or uncompress a chunk of data.
For XZ, set this to select the x86 BCJ filter.
For LZ4, set this to use high compression mode.
SQFS_API const char * sqfs_compressor_name_from_id(SQFS_COMPRESSOR id)
Get the name of a compressor backend from its ID.
int(* write_options)(sqfs_compressor_t *cmp, sqfs_file_t *file)
Write compressor options to disk if non-default settings have been used.
Set this if the compressor should actually extract instead of compress data.
sqfs_u8 lp
Number of literal position bits.
SQFS_API int sqfs_compressor_create(const sqfs_compressor_config_t *cfg, sqfs_compressor_t **out)
Create an instance of a compressor implementation.
For zlib deflate, set this to try the fixed strategy.
Base interface for all libsquashfs in-memory data structures.
void(* get_configuration)(const sqfs_compressor_t *cmp, sqfs_compressor_config_t *cfg)
Get the current compressor configuration.
struct sqfs_compressor_config_t::@0::@1 gzip
Options for the zlib compressor.
sqfs_u32 dict_size
LZMA dictionary size.
For XZ, set this to select the ARM BCJ filter.
Contains on-disk data structures, identifiers and functions for the SquashFS super block...
sqfs_u16 window_size
Deflate window size. Value between 8 and 15.
union sqfs_compressor_config_t::@0 opt
Backend specific options for fine tuing.
sqfs_u16 algorithm
Which variant of lzo should be used.
For XZ, set this to select the Sparc BCJ filter.
Tell the XZ compressor to try the "extreme" option.
Includes forward declarations of data structures, macros and integer types.
struct sqfs_compressor_config_t::@0::@3 xz
Options for the LZMA and XZ (LZMA v2) compressors.
sqfs_u32 block_size
The intended data block size.
For zlib deflate, set this to try the default strategy.
For XZ, set this to select the ARM Thumb BCJ filter.
SQFS_API int sqfs_compressor_id_from_name(const char *name)
Get the compressor ID using just the name of the backend.
For zlib deflate, set this to try the huffman only strategy.
For zlib deflate, set this to try the RLE strategy.
SQFS_COMP_FLAG
Flags for configuring the compressor.
For XZ, set this to select the Itanium BCJ filter.
SQFS_COMPRESSOR
Set in sqfs_super_t to identify the compresser used by the filesystem.
SQFS_API int sqfs_compressor_config_init(sqfs_compressor_config_t *cfg, SQFS_COMPRESSOR id, size_t block_size, sqfs_u16 flags)
Initialize a compressor configuration.
int(* read_options)(sqfs_compressor_t *cmp, sqfs_file_t *file)
Read compressor options from disk.