2017-04-18 03:14:36 +02:00
|
|
|
/* Copyright (c) 2003, Roger Dingledine
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2018-06-20 14:13:28 +02:00
|
|
|
* Copyright (c) 2007-2018, The Tor Project, Inc. */
|
2017-04-18 03:14:36 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file compress_zlib.h
|
|
|
|
* \brief Header for compress_zlib.c
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_COMPRESS_ZLIB_H
|
|
|
|
#define TOR_COMPRESS_ZLIB_H
|
|
|
|
|
2017-04-25 03:36:30 +02:00
|
|
|
int tor_zlib_method_supported(void);
|
2017-04-20 15:56:38 +02:00
|
|
|
|
2017-04-25 03:36:30 +02:00
|
|
|
const char *tor_zlib_get_version_str(void);
|
2017-04-18 03:14:36 +02:00
|
|
|
|
2017-04-25 03:36:30 +02:00
|
|
|
const char *tor_zlib_get_header_version_str(void);
|
2017-04-18 03:14:36 +02:00
|
|
|
|
|
|
|
/** Internal state for an incremental zlib/gzip compression/decompression. */
|
|
|
|
typedef struct tor_zlib_compress_state_t tor_zlib_compress_state_t;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2017-11-17 18:27:25 +01:00
|
|
|
void tor_zlib_compress_free_(tor_zlib_compress_state_t *state);
|
2017-12-04 21:09:18 +01:00
|
|
|
#define tor_zlib_compress_free(st) \
|
2017-12-07 16:44:04 +01:00
|
|
|
FREE_AND_NULL(tor_zlib_compress_state_t, \
|
2017-12-04 21:09:18 +01:00
|
|
|
tor_zlib_compress_free_, (st))
|
2017-04-18 03:14:36 +02:00
|
|
|
|
2017-04-25 03:36:30 +02:00
|
|
|
size_t tor_zlib_compress_state_size(const tor_zlib_compress_state_t *state);
|
2017-04-18 03:14:36 +02:00
|
|
|
|
2017-04-25 03:36:30 +02:00
|
|
|
size_t tor_zlib_get_total_allocation(void);
|
2017-04-18 03:14:36 +02:00
|
|
|
|
2017-04-25 16:29:07 +02:00
|
|
|
void tor_zlib_init(void);
|
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* !defined(TOR_COMPRESS_ZLIB_H) */
|
2017-04-18 03:14:36 +02:00
|
|
|
|