compress_zstd.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Copyright (c) 2003, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2017, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. /**
  6. * \file compress_zstd.h
  7. * \brief Header for compress_zstd.c
  8. **/
  9. #ifndef TOR_COMPRESS_ZSTD_H
  10. #define TOR_COMPRESS_ZSTD_H
  11. int tor_zstd_method_supported(void);
  12. const char *tor_zstd_get_version_str(void);
  13. const char *tor_zstd_get_header_version_str(void);
  14. /** Internal state for an incremental Zstandard compression/decompression. */
  15. typedef struct tor_zstd_compress_state_t tor_zstd_compress_state_t;
  16. tor_zstd_compress_state_t *
  17. tor_zstd_compress_new(int compress,
  18. compress_method_t method,
  19. compression_level_t compression_level);
  20. tor_compress_output_t
  21. tor_zstd_compress_process(tor_zstd_compress_state_t *state,
  22. char **out, size_t *out_len,
  23. const char **in, size_t *in_len,
  24. int finish);
  25. void tor_zstd_compress_free(tor_zstd_compress_state_t *state);
  26. size_t tor_zstd_compress_state_size(const tor_zstd_compress_state_t *state);
  27. size_t tor_zstd_get_total_allocation(void);
  28. void tor_zstd_init(void);
  29. #endif /* !defined(TOR_COMPRESS_ZSTD_H) */