Squash  0.7.0
Data Fields
SquashCodecImpl Struct Reference

Function table for plugins. More...

Data Fields

SquashCodecInfo info
 Capability information about the codec.
 
const SquashOptionInfo * options
 options which may bo passed to the codec to modify its operation
 
SquashStream *(* create_stream )(SquashCodec *codec, SquashStreamType stream_type, SquashOptions *options)
 Create a new SquashStream. More...
 
SquashStatus(* process_stream )(SquashStream *stream, SquashOperation operation)
 Process a SquashStream. More...
 
SquashStatus(* decompress_buffer )(SquashCodec *codec, size_t *decompressed_length, uint8_t decompressed[SQUASH_ARRAY_PARAM(*decompressed_length)], size_t compressed_length, const uint8_t compressed[SQUASH_ARRAY_PARAM(compressed_length)], SquashOptions *options)
 Decompress a buffer. More...
 
SquashStatus(* compress_buffer )(SquashCodec *codec, size_t *compressed_length, uint8_t compressed[SQUASH_ARRAY_PARAM(*compressed_length)], size_t uncompressed_length, const uint8_t uncompressed[SQUASH_ARRAY_PARAM(uncompressed_length)], SquashOptions *options)
 Compress a buffer. More...
 
SquashStatus(* compress_buffer_unsafe )(SquashCodec *codec, size_t *compressed_length, uint8_t compressed[SQUASH_ARRAY_PARAM(*compressed_length)], size_t uncompressed_length, const uint8_t uncompressed[SQUASH_ARRAY_PARAM(uncompressed_length)], SquashOptions *options)
 Compress a buffer. More...
 
size_t(* get_uncompressed_size )(SquashCodec *codec, size_t compressed_length, const uint8_t compressed[SQUASH_ARRAY_PARAM(compressed_length)])
 Get the buffer's uncompressed size. More...
 
size_t(* get_max_compressed_size )(SquashCodec *codec, size_t uncompressed_length)
 Get the maximum compressed size. More...
 
void(* _reserved1 )(void)
 Reserved for future use.
 
void(* _reserved2 )(void)
 Reserved for future use.
 
void(* _reserved3 )(void)
 Reserved for future use.
 
void(* _reserved4 )(void)
 Reserved for future use.
 
void(* _reserved5 )(void)
 Reserved for future use.
 
void(* _reserved6 )(void)
 Reserved for future use.
 
void(* _reserved7 )(void)
 Reserved for future use.
 
void(* _reserved8 )(void)
 Reserved for future use.
 

Detailed Description

Function table for plugins.

This struct should only be used from within a plugin.

This structure may grow over time to accomodate new features, so when setting up the callbacks in a plugin you must set each field individually instead of copying an entire instance of the struct.

Definition at line 51 of file codec.h.

Field Documentation

SquashCodecImpl::compress_buffer

Compress a buffer.

Parameters
codecThe codec.
uncompressedThe uncompressed data.
uncompressed_lengthThe length of the uncompressed data.
compressedBuffer in which to store the compressed data.
compressed_lengthLocation of the buffer size on input, used to store the length of the compressed data on output.
optionsCompression options (or NULL)
See also
squash_codec_compress_with_options

Definition at line 67 of file codec.h.

SquashCodecImpl::compress_buffer_unsafe

Compress a buffer.

Plugins implementing this function can be sure that compressed is at least as long as the maximum compressed length for a buffer of uncompressed_length bytes.

Parameters
codecThe codec.
uncompressedThe uncompressed data.
uncompressed_lengthThe length of the uncompressed data.
compressedBuffer in which to store the compressed data.
compressed_lengthLocation of the buffer size on input, used to store the length of the compressed data on output.
optionsCompression options (or NULL)
See also
squash_codec_compress_with_options

Definition at line 73 of file codec.h.

SquashCodecImpl::create_stream

Create a new SquashStream.

Parameters
codecThe codec.
stream_typeThe type of stream to create.
optionsThe stream options.
Returns
A new SquashStream.
See also
squash_codec_create_stream

Definition at line 57 of file codec.h.

SquashCodecImpl::decompress_buffer

Decompress a buffer.

Parameters
codecThe codec.
compressedThe compressed data.
compressed_lengthThe length of the compressed data.
uncompressedBuffer in which to store the uncompressed data.
uncompressed_lengthLocation of the buffer size on input, used to store the length of the uncompressed data on output.
optionsDecompression options (or NULL)
See also
squash_codec_decompress_with_options

Definition at line 61 of file codec.h.

SquashCodecImpl::get_max_compressed_size

Get the maximum compressed size.

Parameters
codecThe codec.
uncompressed_lengthSize of the uncompressed data.
Returns
The maximum buffer size necessary to contain the compressed data.
See also
squash_codec_get_max_compressed_size

Definition at line 84 of file codec.h.

SquashCodecImpl::get_uncompressed_size

Get the buffer's uncompressed size.

Parameters
codecThe codec.
compressedCompressed data.
compressed_lengthCompressed data length (in bytes).
Returns
Size of the uncompressed data, or 0 if unknown.
See also
squash_codec_get_uncompressed_size

Definition at line 81 of file codec.h.

SquashCodecImpl::process_stream

Process a SquashStream.

Parameters
streamThe stream.
operationThe operation to perform.
Returns
A status code.
See also
squash_stream_process

Definition at line 58 of file codec.h.


The documentation for this struct was generated from the following files: