tor
master
|
Header for compress_zlib.c. More...
Go to the source code of this file.
Macros | |
#define | tor_zlib_compress_free(st) |
Typedefs | |
typedef struct tor_zlib_compress_state_t | tor_zlib_compress_state_t |
Functions | |
int | tor_zlib_method_supported (void) |
const char * | tor_zlib_get_version_str (void) |
const char * | tor_zlib_get_header_version_str (void) |
tor_zlib_compress_state_t * | tor_zlib_compress_new (int compress, compress_method_t method, compression_level_t compression_level) |
tor_compress_output_t | tor_zlib_compress_process (tor_zlib_compress_state_t *state, char **out, size_t *out_len, const char **in, size_t *in_len, int finish) |
void | tor_zlib_compress_free_ (tor_zlib_compress_state_t *state) |
size_t | tor_zlib_compress_state_size (const tor_zlib_compress_state_t *state) |
size_t | tor_zlib_get_total_allocation (void) |
void | tor_zlib_init (void) |
Header for compress_zlib.c.
#define tor_zlib_compress_free | ( | st | ) |
typedef struct tor_zlib_compress_state_t tor_zlib_compress_state_t |
Internal state for an incremental zlib/gzip compression/decompression.
void tor_zlib_compress_free_ | ( | tor_zlib_compress_state_t * | state | ) |
Deallocate state.
tor_zlib_compress_state_t* tor_zlib_compress_new | ( | int | compress_, |
compress_method_t | method, | ||
compression_level_t | compression_level | ||
) |
Construct and return a tor_zlib_compress_state_t object using method. If compress, it's for compression; otherwise it's for decompression.
tor_compress_output_t tor_zlib_compress_process | ( | tor_zlib_compress_state_t * | state, |
char ** | out, | ||
size_t * | out_len, | ||
const char ** | in, | ||
size_t * | in_len, | ||
int | finish | ||
) |
Compress/decompress some bytes using state. Read up to *in_len bytes from *in, and write up to *out_len bytes to *out, adjusting the values as we go. If finish is true, we've reached the end of the input.
Return TOR_COMPRESS_DONE if we've finished the entire compression/decompression. Return TOR_COMPRESS_OK if we're processed everything from the input. Return TOR_COMPRESS_BUFFER_FULL if we're out of space on out. Return TOR_COMPRESS_ERROR if the stream is corrupt.
size_t tor_zlib_compress_state_size | ( | const tor_zlib_compress_state_t * | state | ) |
Return the approximate number of bytes allocated for state.
const char* tor_zlib_get_header_version_str | ( | void | ) |
Return a string representation of the version of the version of zlib used at compilation.
size_t tor_zlib_get_total_allocation | ( | void | ) |
Return the approximate number of bytes allocated for all zlib states.
const char* tor_zlib_get_version_str | ( | void | ) |
Return a string representation of the version of the currently running version of zlib.
void tor_zlib_init | ( | void | ) |
Set up global state for the zlib module
int tor_zlib_method_supported | ( | void | ) |
Return 1 if zlib/gzip compression is supported; otherwise 0.