Tor  0.4.7.0-alpha-dev
compress_zstd.h
Go to the documentation of this file.
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 */
5 
6 /**
7  * \file compress_zstd.h
8  * \brief Header for compress_zstd.c
9  **/
10 
11 #ifndef TOR_COMPRESS_ZSTD_H
12 #define TOR_COMPRESS_ZSTD_H
13 
15 
16 const char *tor_zstd_get_version_str(void);
17 
18 const char *tor_zstd_get_header_version_str(void);
19 
21 
22 /** Internal state for an incremental Zstandard compression/decompression. */
24 
27  compress_method_t method,
28  compression_level_t compression_level);
29 
32  char **out, size_t *out_len,
33  const char **in, size_t *in_len,
34  int finish);
35 
37 #define tor_zstd_compress_free(st) \
38  FREE_AND_NULL(tor_zstd_compress_state_t, \
39  tor_zstd_compress_free_, (st))
40 
42 
44 
45 void tor_zstd_init(void);
47 
48 #ifdef TOR_UNIT_TESTS
49 void tor_zstd_set_static_apis_disabled_for_testing(int disabled);
50 #endif
51 
52 #endif /* !defined(TOR_COMPRESS_ZSTD_H) */
53 
tor_compress_output_t
Definition: compress.h:68
compress_method_t
Definition: compress.h:21
compression_level_t
Definition: compress.h:35
void tor_zstd_compress_free_(tor_zstd_compress_state_t *state)
int tor_zstd_method_supported(void)
Definition: compress_zstd.c:60
int tor_zstd_can_use_static_apis(void)
void tor_zstd_init(void)
tor_compress_output_t tor_zstd_compress_process(tor_zstd_compress_state_t *state, char **out, size_t *out_len, const char **in, size_t *in_len, int finish)
const char * tor_zstd_get_version_str(void)
Definition: compress_zstd.c:87
size_t tor_zstd_get_total_allocation(void)
const char * tor_zstd_get_header_version_str(void)
size_t tor_zstd_compress_state_size(const tor_zstd_compress_state_t *state)
void tor_zstd_warn_if_version_mismatched(void)
tor_zstd_compress_state_t * tor_zstd_compress_new(int compress, compress_method_t method, compression_level_t compression_level)