Rizin
unix-like reverse engineering framework and cli tools
easy_buffer_encoder.c
Go to the documentation of this file.
1 //
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 //
12 
13 #include "easy_preset.h"
14 
15 
17 lzma_easy_buffer_encode(uint32_t preset, lzma_check check,
18  const lzma_allocator *allocator, const uint8_t *in,
19  size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size)
20 {
21  lzma_options_easy opt_easy;
22  if (lzma_easy_preset(&opt_easy, preset))
23  return LZMA_OPTIONS_ERROR;
24 
25  return lzma_stream_buffer_encode(opt_easy.filters, check,
26  allocator, in, in_size, out, out_pos, out_size);
27 }
lzma_check
Type of the integrity check (Check ID)
Definition: check.h:27
const lzma_allocator const uint8_t size_t uint8_t size_t * out_pos
Definition: block.h:528
const lzma_allocator const uint8_t size_t in_size
Definition: block.h:527
const lzma_allocator * allocator
Definition: block.h:377
const lzma_allocator const uint8_t * in
Definition: block.h:527
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
uint32_t preset
Definition: container.h:259
lzma_check check
Definition: container.h:292
LZMA_API(lzma_ret)
bool lzma_easy_preset(lzma_options_easy *opt_easy, uint32_t preset)
Definition: easy_preset.c:17
Preset handling for easy encoder and decoder.
unsigned int uint32_t
Definition: sftypes.h:29
unsigned char uint8_t
Definition: sftypes.h:31
Custom functions for memory handling.
Definition: base.h:372
lzma_filter filters[LZMA_FILTERS_MAX+1]
Definition: easy_preset.h:19
lzma_ret
Return values used by several functions in liblzma.
Definition: base.h:57
@ LZMA_OPTIONS_ERROR
Invalid or unsupported options.
Definition: base.h:160