11 #ifndef TOR_COMPRESS_H
12 #define TOR_COMPRESS_H
36 BEST_COMPRESSION, HIGH_COMPRESSION, MEDIUM_COMPRESSION, LOW_COMPRESSION
40 const char *in,
size_t in_len,
44 const char *in,
size_t in_len,
47 int protocol_warn_level);
71 TOR_COMPRESS_BUFFER_FULL,
83 char **out,
size_t *out_len,
84 const char **in,
size_t *in_len,
87 #define tor_compress_free(st) \
88 FREE_AND_NULL(tor_compress_state_t, tor_compress_free_, (st))
97 const char *data,
size_t data_len,
int done);
int tor_compress_init(void)
tor_compress_output_t tor_compress_process(tor_compress_state_t *state, char **out, size_t *out_len, const char **in, size_t *in_len, int finish)
tor_compress_state_t * tor_compress_new(int compress, compress_method_t method, compression_level_t level)
int tor_compress_supports_method(compress_method_t method)
compress_method_t compression_method_get_by_name(const char *name)
int tor_compress_is_compression_bomb(size_t size_in, size_t size_out)
const char * compression_method_get_name(compress_method_t method)
void tor_compress_free_(tor_compress_state_t *state)
const char * tor_compress_header_version_str(compress_method_t method)
const char * compression_method_get_human_name(compress_method_t method)
unsigned tor_compress_get_supported_method_bitmask(void)
size_t tor_compress_state_size(const tor_compress_state_t *state)
void tor_compress_log_init_warnings(void)
int tor_compress(char **out, size_t *out_len, const char *in, size_t in_len, compress_method_t method)
const char * tor_compress_version_str(compress_method_t method)
int buf_add_compress(struct buf_t *buf, struct tor_compress_state_t *state, const char *data, size_t data_len, int done)
compress_method_t detect_compression_method(const char *in, size_t in_len)
int tor_uncompress(char **out, size_t *out_len, const char *in, size_t in_len, compress_method_t method, int complete_only, int protocol_warn_level)
size_t tor_compress_get_total_allocation(void)
Macros to implement mocking and selective exposure for the test code.
#define MOCK_DECL(rv, funcname, arglist)