libsquashfs
1.3.2
A new set of tools and libraries for working with SquashFS images
|
Contains declarations to everything related to data compression. More...
Go to the source code of this file.
Data Structures | |
interface | sqfs_compressor_t |
Encapsultes a compressor with a simple interface to compress or extract chunks of data. More... | |
struct | sqfs_compressor_config_t |
Configuration parameters for instantiating a compressor backend. More... | |
Enumerations | |
enum | SQFS_COMP_FLAG { SQFS_COMP_FLAG_LZ4_HC = 0x0001, SQFS_COMP_FLAG_LZ4_ALL = 0x0001, SQFS_COMP_FLAG_LZMA_EXTREME = 0x0001, SQFS_COMP_FLAG_LZMA_ALL = 0x0001, SQFS_COMP_FLAG_XZ_X86 = 0x0001, SQFS_COMP_FLAG_XZ_POWERPC = 0x0002, SQFS_COMP_FLAG_XZ_IA64 = 0x0004, SQFS_COMP_FLAG_XZ_ARM = 0x0008, SQFS_COMP_FLAG_XZ_ARMTHUMB = 0x0010, SQFS_COMP_FLAG_XZ_SPARC = 0x0020, SQFS_COMP_FLAG_XZ_EXTREME = 0x0100, SQFS_COMP_FLAG_XZ_ALL = 0x013F, SQFS_COMP_FLAG_GZIP_DEFAULT = 0x0001, SQFS_COMP_FLAG_GZIP_FILTERED = 0x0002, SQFS_COMP_FLAG_GZIP_HUFFMAN = 0x0004, SQFS_COMP_FLAG_GZIP_RLE = 0x0008, SQFS_COMP_FLAG_GZIP_FIXED = 0x0010, SQFS_COMP_FLAG_GZIP_ALL = 0x001F, SQFS_COMP_FLAG_UNCOMPRESS = 0x8000, SQFS_COMP_FLAG_GENERIC_ALL = 0x8000 } |
Flags for configuring the compressor. More... | |
enum | SQFS_LZO_ALGORITHM { SQFS_LZO1X_1 = 0, SQFS_LZO1X_1_11 = 1, SQFS_LZO1X_1_12 = 2, SQFS_LZO1X_1_15 = 3, SQFS_LZO1X_999 = 4 } |
The available LZO algorithms. | |
Functions | |
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. More... | |
SQFS_API int | sqfs_compressor_create (const sqfs_compressor_config_t *cfg, sqfs_compressor_t **out) |
Create an instance of a compressor implementation. More... | |
SQFS_API const char * | sqfs_compressor_name_from_id (SQFS_COMPRESSOR id) |
Get the name of a compressor backend from its ID. More... | |
SQFS_API int | sqfs_compressor_id_from_name (const char *name) |
Get the compressor ID using just the name of the backend. More... | |
Contains declarations to everything related to data compression.
Definition in file compressor.h.
enum SQFS_COMP_FLAG |
Flags for configuring the compressor.
Definition at line 227 of file compressor.h.
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.
The detail configuration options are all initialized to the defaults for the compressor in question.
cfg | A pointer to a compressor configuration to initialize |
id | The compressor id to set. |
block_size | The block size to set. |
flags | The compressor flags to set. |
SQFS_API int sqfs_compressor_create | ( | const sqfs_compressor_config_t * | cfg, |
sqfs_compressor_t ** | out | ||
) |
Create an instance of a compressor implementation.
If this function returns SQFS_ERROR_UNSUPPORTED, it can mean that either the compressor is not supported at all by the version of libsquashfs you are using, or that the specific configuration that has been requested is not supported (e.g. unknown flags, or the local version can only uncompress, but not compress).
cfg | A pointer to a compressor configuration. |
out | Returns a pointer to the compressor on success. |
SQFS_API int sqfs_compressor_id_from_name | ( | const char * | name | ) |
Get the compressor ID using just the name of the backend.
name | The name of the compressor backend. |
SQFS_API const char* sqfs_compressor_name_from_id | ( | SQFS_COMPRESSOR | id | ) |
Get the name of a compressor backend from its ID.
id | An SQFS_COMPRESSOR identifier. |