aboutsummaryrefslogtreecommitdiff
path: root/src/common/torgzip.h
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-04-18 03:14:36 +0200
committerNick Mathewson <nickm@torproject.org>2017-04-25 08:06:01 -0400
commit9d5bc1a9354637aa59025f61e577c6d42f8c53ba (patch)
tree509406ce51588c6a7e38586c593313e5303327b4 /src/common/torgzip.h
parente6c6606a17841eaf263967254990db5e9443942d (diff)
downloadtor-9d5bc1a9354637aa59025f61e577c6d42f8c53ba.tar.gz
tor-9d5bc1a9354637aa59025f61e577c6d42f8c53ba.zip
Move zlib compression code into its own module.
This patch refactors the `torgzip` module to allow us to extend a common compression API to support multiple compression backends. Additionally we move the gzip/zlib code into its own module under the name `compress_zlib`. See https://bugs.torproject.org/21664
Diffstat (limited to 'src/common/torgzip.h')
-rw-r--r--src/common/torgzip.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/common/torgzip.h b/src/common/torgzip.h
index fa566282d7..0fcac0c946 100644
--- a/src/common/torgzip.h
+++ b/src/common/torgzip.h
@@ -38,12 +38,6 @@ tor_uncompress(char **out, size_t *out_len,
int complete_only,
int protocol_warn_level);
-const char *
-tor_zlib_get_version_str(void);
-
-const char *
-tor_zlib_get_header_version_str(void);
-
compress_method_t detect_compression_method(const char *in, size_t in_len);
int
@@ -60,8 +54,10 @@ typedef enum {
TOR_COMPRESS_BUFFER_FULL,
TOR_COMPRESS_ERROR
} tor_compress_output_t;
-/** Internal state for an incremental zlib compression/decompression. */
+
+/** Internal state for an incremental compression/decompression. */
typedef struct tor_compress_state_t tor_compress_state_t;
+
tor_compress_state_t *tor_compress_new(int compress,
compress_method_t method,
compression_level_t level);
@@ -73,7 +69,6 @@ tor_compress_output_t tor_compress_process(tor_compress_state_t *state,
void tor_compress_free(tor_compress_state_t *state);
size_t tor_compress_state_size(const tor_compress_state_t *state);
-size_t tor_zlib_get_total_allocation(void);
#endif