lzma_encoder.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file lzma_encoder.h
  4. /// \brief LZMA encoder API
  5. ///
  6. // Authors: Igor Pavlov
  7. // Lasse Collin
  8. //
  9. // This file has been put into the public domain.
  10. // You can do whatever you want with this file.
  11. //
  12. ///////////////////////////////////////////////////////////////////////////////
  13. #ifndef LZMA_LZMA_ENCODER_H
  14. #define LZMA_LZMA_ENCODER_H
  15. #include "common.h"
  16. typedef struct lzma_lzma1_encoder_s lzma_lzma1_encoder;
  17. extern lzma_ret lzma_lzma_encoder_init(lzma_next_coder *next,
  18. const lzma_allocator *allocator,
  19. const lzma_filter_info *filters);
  20. extern uint64_t lzma_lzma_encoder_memusage(const void *options);
  21. extern lzma_ret lzma_lzma_props_encode(const void *options, uint8_t *out);
  22. /// Encodes lc/lp/pb into one byte. Returns false on success and true on error.
  23. extern bool lzma_lzma_lclppb_encode(
  24. const lzma_options_lzma *options, uint8_t *byte);
  25. #ifdef LZMA_LZ_ENCODER_H
  26. /// Initializes raw LZMA encoder; this is used by LZMA2.
  27. extern lzma_ret lzma_lzma_encoder_create(
  28. void **coder_ptr, const lzma_allocator *allocator,
  29. const lzma_options_lzma *options, lzma_lz_options *lz_options);
  30. /// Resets an already initialized LZMA encoder; this is used by LZMA2.
  31. extern lzma_ret lzma_lzma_encoder_reset(
  32. lzma_lzma1_encoder *coder, const lzma_options_lzma *options);
  33. extern lzma_ret lzma_lzma_encode(lzma_lzma1_encoder *restrict coder,
  34. lzma_mf *restrict mf, uint8_t *restrict out,
  35. size_t *restrict out_pos, size_t out_size,
  36. uint32_t read_limit);
  37. #endif
  38. #endif