lzma_encoder.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. extern lzma_ret lzma_lzma_encoder_init(lzma_next_coder *next,
  17. lzma_allocator *allocator, const lzma_filter_info *filters);
  18. extern uint64_t lzma_lzma_encoder_memusage(const void *options);
  19. extern lzma_ret lzma_lzma_props_encode(const void *options, uint8_t *out);
  20. /// Encodes lc/lp/pb into one byte. Returns false on success and true on error.
  21. extern bool lzma_lzma_lclppb_encode(
  22. const lzma_options_lzma *options, uint8_t *byte);
  23. #ifdef LZMA_LZ_ENCODER_H
  24. /// Initializes raw LZMA encoder; this is used by LZMA2.
  25. extern lzma_ret lzma_lzma_encoder_create(
  26. lzma_coder **coder_ptr, lzma_allocator *allocator,
  27. const lzma_options_lzma *options, lzma_lz_options *lz_options);
  28. /// Resets an already initialized LZMA encoder; this is used by LZMA2.
  29. extern lzma_ret lzma_lzma_encoder_reset(
  30. lzma_coder *coder, const lzma_options_lzma *options);
  31. extern lzma_ret lzma_lzma_encode(lzma_coder *LZMA_RESTRICT coder,
  32. lzma_mf *LZMA_RESTRICT mf, uint8_t *LZMA_RESTRICT out,
  33. size_t *LZMA_RESTRICT out_pos, size_t out_size,
  34. uint32_t read_limit);
  35. #endif
  36. #endif