Merge branch 'maint-0.4.8'
[tor.git] / src / lib / compress / compress_lzma.h
blobc615968378860efbda919bb9719a2afc2a5d4acf
1 /* Copyright (c) 2003, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
6 /**
7 * \file compress_lzma.h
8 * \brief Header for compress_lzma.c
9 **/
11 #ifndef TOR_COMPRESS_LZMA_H
12 #define TOR_COMPRESS_LZMA_H
14 int tor_lzma_method_supported(void);
16 const char *tor_lzma_get_version_str(void);
18 const char *tor_lzma_get_header_version_str(void);
20 /** Internal state for an incremental LZMA compression/decompression. */
21 typedef struct tor_lzma_compress_state_t tor_lzma_compress_state_t;
23 tor_lzma_compress_state_t *
24 tor_lzma_compress_new(int compress,
25 compress_method_t method,
26 compression_level_t compression_level);
28 tor_compress_output_t
29 tor_lzma_compress_process(tor_lzma_compress_state_t *state,
30 char **out, size_t *out_len,
31 const char **in, size_t *in_len,
32 int finish);
34 void tor_lzma_compress_free_(tor_lzma_compress_state_t *state);
35 #define tor_lzma_compress_free(st) \
36 FREE_AND_NULL(tor_lzma_compress_state_t, \
37 tor_lzma_compress_free_, (st))
39 size_t tor_lzma_compress_state_size(const tor_lzma_compress_state_t *state);
41 size_t tor_lzma_get_total_allocation(void);
43 void tor_lzma_init(void);
45 #endif /* !defined(TOR_COMPRESS_LZMA_H) */