compress_lzma.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_lzma.h
  7. * \brief Header for compress_lzma.c
  8. **/
  9. #ifndef TOR_COMPRESS_LZMA_H
  10. #define TOR_COMPRESS_LZMA_H
  11. const char *
  12. tor_lzma_get_version_str(void);
  13. const char *
  14. tor_lzma_get_header_version_str(void);
  15. int
  16. tor_lzma_compress(char **out, size_t *out_len,
  17. const char *in, size_t in_len,
  18. compress_method_t method);
  19. int
  20. tor_lzma_uncompress(char **out, size_t *out_len,
  21. const char *in, size_t in_len,
  22. compress_method_t method,
  23. int complete_only,
  24. int protocol_warn_level);
  25. /** Internal state for an incremental LZMA compression/decompression. */
  26. typedef struct tor_lzma_compress_state_t tor_lzma_compress_state_t;
  27. tor_lzma_compress_state_t *
  28. tor_lzma_compress_new(int compress,
  29. compress_method_t method,
  30. compression_level_t compression_level);
  31. tor_compress_output_t
  32. tor_lzma_compress_process(tor_lzma_compress_state_t *state,
  33. char **out, size_t *out_len,
  34. const char **in, size_t *in_len,
  35. int finish);
  36. void
  37. tor_lzma_compress_free(tor_lzma_compress_state_t *state);
  38. size_t
  39. tor_lzma_compress_state_size(const tor_lzma_compress_state_t *state);
  40. size_t
  41. tor_lzma_get_total_allocation(void);
  42. #endif // TOR_COMPRESS_LZMA_H.