libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
Loading...
Searching...
No Matches
sqfs_compressor_t Interface Reference

Encapsultes a compressor with a simple interface to compress or extract chunks of data. More...

#include <compressor.h>

Inheritance diagram for sqfs_compressor_t:
Inheritance graph
Collaboration diagram for sqfs_compressor_t:
Collaboration graph

Data Fields

sqfs_object_t base
 
void(* get_configuration )(const sqfs_compressor_t *cmp, sqfs_compressor_config_t *cfg)
 Get the current compressor configuration.
 
int(* write_options )(sqfs_compressor_t *cmp, sqfs_file_t *file)
 Write compressor options to disk if non-default settings have been used.
 
int(* read_options )(sqfs_compressor_t *cmp, sqfs_file_t *file)
 Read compressor options from disk.
 
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.
 
- Data Fields inherited from sqfs_object_t
void(* destroy )(struct sqfs_object_t *instance)
 
struct sqfs_object_t *(* copy )(const struct sqfs_object_t *orig)
 

Additional Inherited Members

- Static Public Member Functions inherited from sqfs_object_t
static SQFS_INLINE void sqfs_destroy (void *obj)
 Destroy an object and free all its memory.
 
static SQFS_INLINE void * sqfs_copy (const void *obj)
 Create a deep copy of an object if possible.
 

Detailed Description

Encapsultes a compressor with a simple interface to compress or extract chunks of data.

Examples
list_files.c.

Definition at line 40 of file compressor.h.

Field Documentation

◆ base

Definition at line 41 of file compressor.h.

◆ do_block

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.

Parameters
cmpA pointer to a compressor object.
inA pointer to the input buffer to read from.
sizeThe number of bytes to read from the input and compress.
outThe destination buffer to write the result to.
outsizeThe available space in the destination buffer.
Returns
The number of bytes written to the buffer, a negative value is an SQFS_ERROR value. The value 0 means the output buffer was too small when extracting or that the result is larger than the input when compressing.

Definition at line 92 of file compressor.h.

◆ get_configuration

void(* get_configuration) (const sqfs_compressor_t *cmp, sqfs_compressor_config_t *cfg)

Get the current compressor configuration.

Parameters
cmpA pointer to the compressor object.
cfgA pointer to the object to write the configuration to.

Definition at line 49 of file compressor.h.

◆ read_options

int(* read_options) (sqfs_compressor_t *cmp, sqfs_file_t *file)

Read compressor options from disk.

Parameters
cmpA pointer to a compressor object.
fileA file to read from.
Returns
Zero on success or an SQFS_ERROR value.

Definition at line 76 of file compressor.h.

◆ write_options

int(* write_options) (sqfs_compressor_t *cmp, sqfs_file_t *file)

Write compressor options to disk if non-default settings have been used.

The options are stored in an uncompressed meta data block directly after the super block.

Parameters
cmpA pointer to a compressor object.
fileA file to write to.
Returns
The number of bytes written on success, 0 means default settings are used. A negative value is an SQFS_ERROR identifier.

Definition at line 66 of file compressor.h.


The documentation for this interface was generated from the following file: