libctru
v2.4.1
|
Decompression functions. More...
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
Go to the source code of this file.
Data Structures | |
struct | decompressIOVec |
I/O vector. More... | |
Typedefs | |
typedef ssize_t(* | decompressCallback) (void *userdata, void *buffer, size_t size) |
Data callback. | |
Enumerations | |
enum | decompressType { DECOMPRESS_DUMMY = 0x00 , DECOMPRESS_LZSS = 0x10 , DECOMPRESS_LZ10 = 0x10 , DECOMPRESS_LZ11 = 0x11 , DECOMPRESS_HUFF1 = 0x21 , DECOMPRESS_HUFF2 = 0x22 , DECOMPRESS_HUFF3 = 0x23 , DECOMPRESS_HUFF4 = 0x24 , DECOMPRESS_HUFF5 = 0x25 , DECOMPRESS_HUFF6 = 0x26 , DECOMPRESS_HUFF7 = 0x27 , DECOMPRESS_HUFF8 = 0x28 , DECOMPRESS_HUFF = 0x28 , DECOMPRESS_RLE = 0x30 } |
Compression types. More... | |
Functions | |
ssize_t | decompressCallback_FD (void *userdata, void *buffer, size_t size) |
Decompression callback for file descriptors. More... | |
ssize_t | decompressCallback_Stdio (void *userdata, void *buffer, size_t size) |
Decompression callback for stdio FILE*. More... | |
ssize_t | decompressHeader (decompressType *type, size_t *size, decompressCallback callback, void *userdata, size_t insize) |
Decode decompression header. More... | |
bool | decompressV (const decompressIOVec *iov, size_t iovcnt, decompressCallback callback, void *userdata, size_t insize) |
Decompress data. More... | |
static bool | decompress (void *output, size_t size, decompressCallback callback, void *userdata, size_t insize) |
Decompress data. More... | |
bool | decompressV_LZSS (const decompressIOVec *iov, size_t iovcnt, decompressCallback callback, void *userdata, size_t insize) |
Decompress LZSS/LZ10. More... | |
static bool | decompress_LZSS (void *output, size_t size, decompressCallback callback, void *userdata, size_t insize) |
Decompress LZSS/LZ10. More... | |
bool | decompressV_LZ11 (const decompressIOVec *iov, size_t iovcnt, decompressCallback callback, void *userdata, size_t insize) |
Decompress LZ11. More... | |
static bool | decompress_LZ11 (void *output, size_t size, decompressCallback callback, void *userdata, size_t insize) |
Decompress LZ11. More... | |
bool | decompressV_Huff (size_t bits, const decompressIOVec *iov, size_t iovcnt, decompressCallback callback, void *userdata, size_t insize) |
Decompress Huffman. More... | |
static bool | decompress_Huff (size_t bits, void *output, size_t size, decompressCallback callback, void *userdata, size_t insize) |
Decompress Huffman. More... | |
bool | decompressV_RLE (const decompressIOVec *iov, size_t iovcnt, decompressCallback callback, void *userdata, size_t insize) |
Decompress run-length encoding. More... | |
static bool | decompress_RLE (void *output, size_t size, decompressCallback callback, void *userdata, size_t insize) |
Decompress run-length encoding. More... | |
Decompression functions.
enum decompressType |
Compression types.
|
inlinestatic |
Decompress data.
[in] | output | Output buffer |
[in] | size | Output size limit |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
|
inlinestatic |
Decompress Huffman.
[in] | bits | Data size in bits (usually 4 or 8) |
[in] | output | Output buffer |
[in] | size | Output size limit |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
|
inlinestatic |
Decompress LZ11.
[in] | output | Output buffer |
[in] | size | Output size limit |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
|
inlinestatic |
Decompress LZSS/LZ10.
[in] | output | Output buffer |
[in] | size | Output size limit |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
|
inlinestatic |
Decompress run-length encoding.
[in] | output | Output buffer |
[in] | size | Output size limit |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
ssize_t decompressCallback_FD | ( | void * | userdata, |
void * | buffer, | ||
size_t | size | ||
) |
Decompression callback for file descriptors.
[in] | userdata | Address of file descriptor |
[in] | buffer | Buffer to write into |
[in] | size | Size to read from file descriptor |
ssize_t decompressCallback_Stdio | ( | void * | userdata, |
void * | buffer, | ||
size_t | size | ||
) |
Decompression callback for stdio FILE*.
[in] | userdata | FILE* |
[in] | buffer | Buffer to write into |
[in] | size | Size to read from file descriptor |
ssize_t decompressHeader | ( | decompressType * | type, |
size_t * | size, | ||
decompressCallback | callback, | ||
void * | userdata, | ||
size_t | insize | ||
) |
Decode decompression header.
[out] | type | Decompression type |
[out] | size | Decompressed size |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
-1 | error |
bool decompressV | ( | const decompressIOVec * | iov, |
size_t | iovcnt, | ||
decompressCallback | callback, | ||
void * | userdata, | ||
size_t | insize | ||
) |
Decompress data.
[in] | iov | Output vector |
[in] | iovcnt | Number of buffers |
[in] | callback | Data callback (see note) |
[in] | userdata | User data passed to callback (see note) |
[in] | insize | Size of userdata (see note) |
bool decompressV_Huff | ( | size_t | bits, |
const decompressIOVec * | iov, | ||
size_t | iovcnt, | ||
decompressCallback | callback, | ||
void * | userdata, | ||
size_t | insize | ||
) |
Decompress Huffman.
[in] | bits | Data size in bits (usually 4 or 8) |
[in] | iov | Output vector |
[in] | iovcnt | Number of buffers |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
bool decompressV_LZ11 | ( | const decompressIOVec * | iov, |
size_t | iovcnt, | ||
decompressCallback | callback, | ||
void * | userdata, | ||
size_t | insize | ||
) |
Decompress LZ11.
[in] | iov | Output vector |
[in] | iovcnt | Number of buffers |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
bool decompressV_LZSS | ( | const decompressIOVec * | iov, |
size_t | iovcnt, | ||
decompressCallback | callback, | ||
void * | userdata, | ||
size_t | insize | ||
) |
Decompress LZSS/LZ10.
[in] | iov | Output vector |
[in] | iovcnt | Number of buffers |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |
bool decompressV_RLE | ( | const decompressIOVec * | iov, |
size_t | iovcnt, | ||
decompressCallback | callback, | ||
void * | userdata, | ||
size_t | insize | ||
) |
Decompress run-length encoding.
[in] | iov | Output vector |
[in] | iovcnt | Number of buffers |
[in] | callback | Data callback (see decompressV()) |
[in] | userdata | User data passed to callback (see decompressV()) |
[in] | insize | Size of userdata (see decompressV()) |