diff options
author | Alexander Færøy <ahf@torproject.org> | 2017-04-18 14:30:44 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-25 08:10:06 -0400 |
commit | bf1c07cb07c27ca65ab66cf41442cfaabd9bb067 (patch) | |
tree | 2a3cf90c212e253548991e2309cf2880918d9468 /src/common/compress_lzma.h | |
parent | 157af1d26e3cdfc3159c1085f35e5ddcda7ccd21 (diff) | |
download | tor-bf1c07cb07c27ca65ab66cf41442cfaabd9bb067.tar.gz tor-bf1c07cb07c27ca65ab66cf41442cfaabd9bb067.zip |
Add LZMA support.
See: https://bugs.torproject.org/21662
Diffstat (limited to 'src/common/compress_lzma.h')
-rw-r--r-- | src/common/compress_lzma.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/common/compress_lzma.h b/src/common/compress_lzma.h new file mode 100644 index 0000000000..2cc3a00660 --- /dev/null +++ b/src/common/compress_lzma.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2003, Roger Dingledine + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2017, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file compress_lzma.h + * \brief Header for compress_lzma.c + **/ + +#ifndef TOR_COMPRESS_LZMA_H +#define TOR_COMPRESS_LZMA_H + +const char * +tor_lzma_get_version_str(void); + +const char * +tor_lzma_get_header_version_str(void); + +int +tor_lzma_compress(char **out, size_t *out_len, + const char *in, size_t in_len, + compress_method_t method); + +int +tor_lzma_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); + +/** Internal state for an incremental LZMA compression/decompression. */ +typedef struct tor_lzma_compress_state_t tor_lzma_compress_state_t; + +tor_lzma_compress_state_t * +tor_lzma_compress_new(int compress, + compress_method_t method, + compression_level_t compression_level); + +tor_compress_output_t +tor_lzma_compress_process(tor_lzma_compress_state_t *state, + char **out, size_t *out_len, + const char **in, size_t *in_len, + int finish); + +void +tor_lzma_compress_free(tor_lzma_compress_state_t *state); + +size_t +tor_lzma_compress_state_size(const tor_lzma_compress_state_t *state); + +size_t +tor_lzma_get_total_allocation(void); + +#endif // TOR_COMPRESS_LZMA_H. + |