|
libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
|
#include "types.h"
Go to the source code of this file.
Functions | |
| bool_t | zlib_test (const void *in_buf, size_t len) |
| void * | zlib_compress (void *in_buf, size_t len, size_t *out_len) |
| void * | zlib_decompress (void *in_buf, size_t len, size_t *out_len_p) |
| bool_t | test_7z (const void *in_buf, size_t len) |
| void * | decompress_7z (const char *filename, size_t *out_len) |
| void * | decompress_zip (void *in_buf, size_t len, size_t *out_len) |
This file contains various compression/decompression utility functions.
Definition in file compress.h.
| void * decompress_7z | ( | const char * | filename, |
| size_t * | out_len | ||
| ) |
Decompresses the first file contained in a 7-zip archive and returns its contents.
| filename | The full path to the file holding the 7-zip archive. |
| out_len | Return argument, which will be filled with the amount of bytes contained in the returned decompressed buffer. |
Definition at line 61 of file compress_7z.c.
| void * decompress_zip | ( | void * | in_buf, |
| size_t | len, | ||
| size_t * | out_len | ||
| ) |
Definition at line 49 of file compress_zip.c.
| bool_t test_7z | ( | const void * | in_buf, |
| size_t | len | ||
| ) |
Performs a light-weight & quick test to see if some data might constitute a 7-zip archive.
| in_buf | Input buffer to test. |
| len | Number of bytes in in_buf. |
Definition at line 41 of file compress_7z.c.
| void * zlib_compress | ( | void * | in_buf, |
| size_t | len, | ||
| size_t * | out_len | ||
| ) |
Compresses a chunk of data using the zlib algorithm and returns it. The compression ratio applied is the default zlib value (equivalent to "gzip -6").
| in_buf | Input data buffer to be compressed. |
| len | Number of bytes in ‘in_buf’. |
| out_len | Output variable which will be filled the number of bytes contained in the compressed output. |
NULL on an internal compressor error. Definition at line 65 of file compress_zlib.c.
| void * zlib_decompress | ( | void * | in_buf, |
| size_t | len, | ||
| size_t * | out_len_p | ||
| ) |
Decompresses a chunk of data previously compressed using the zlib algorithm. Same arguments as zlib_compress().
NULL on error, or if the input data doesn't look like valid zlib compressed data. Definition at line 128 of file compress_zlib.c.
| bool_t zlib_test | ( | const void * | in_buf, |
| size_t | len | ||
| ) |
Performs a light-weight & quick test to see if some data might constitute zlib-compressed data. Please note that zlib data is NOT the same as a Gzip (.gz) file. A .gz file contains additional metadata that these functions do not understand.
| in_buf | Input buffer to check. |
| len | Input buffer length in bytes. |
Definition at line 40 of file compress_zlib.c.