easy_buffer_encoder.c 840 B

123456789101112131415161718192021222324252627
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file easy_buffer_encoder.c
  4. /// \brief Easy single-call .xz Stream encoder
  5. //
  6. // Author: Lasse Collin
  7. //
  8. // This file has been put into the public domain.
  9. // You can do whatever you want with this file.
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #include "easy_preset.h"
  13. extern LZMA_API(lzma_ret)
  14. lzma_easy_buffer_encode(uint32_t preset, lzma_check check,
  15. const lzma_allocator *allocator, const uint8_t *in,
  16. size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size)
  17. {
  18. lzma_options_easy opt_easy;
  19. if (lzma_easy_preset(&opt_easy, preset))
  20. return LZMA_OPTIONS_ERROR;
  21. return lzma_stream_buffer_encode(opt_easy.filters, check,
  22. allocator, in, in_size, out, out_pos, out_size);
  23. }