compress_lzma.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright (c) 2003, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. /**
  6. * \file compress_lzma.h
  7. * \brief Header for compress_lzma.c
  8. **/
  9. #ifndef TOR_COMPRESS_LZMA_H
  10. #define TOR_COMPRESS_LZMA_H
  11. int tor_lzma_method_supported(void);
  12. const char *tor_lzma_get_version_str(void);
  13. const char *tor_lzma_get_header_version_str(void);
  14. /** Internal state for an incremental LZMA compression/decompression. */
  15. typedef struct tor_lzma_compress_state_t tor_lzma_compress_state_t;
  16. tor_lzma_compress_state_t *
  17. tor_lzma_compress_new(int compress,
  18. compress_method_t method,
  19. compression_level_t compression_level);
  20. tor_compress_output_t
  21. tor_lzma_compress_process(tor_lzma_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_lzma_compress_free_(tor_lzma_compress_state_t *state);
  26. #define tor_lzma_compress_free(st) \
  27. FREE_AND_NULL(tor_lzma_compress_state_t, \
  28. tor_lzma_compress_free_, (st))
  29. size_t tor_lzma_compress_state_size(const tor_lzma_compress_state_t *state);
  30. size_t tor_lzma_get_total_allocation(void);
  31. void tor_lzma_init(void);
  32. #endif /* !defined(TOR_COMPRESS_LZMA_H) */