XZ Utils  5.4.0
Functions
easy_buffer_encoder.c File Reference

Easy single-call .xz Stream encoder. More...

#include "easy_preset.h"

Functions

lzma_ret lzma_easy_buffer_encode (uint32_t preset, lzma_check check, const lzma_allocator *allocator, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size)
 Single-call .xz Stream encoding using a preset number. More...
 

Detailed Description

Easy single-call .xz Stream encoder.

Function Documentation

◆ lzma_easy_buffer_encode()

lzma_ret lzma_easy_buffer_encode ( uint32_t  preset,
lzma_check  check,
const lzma_allocator allocator,
const uint8_t *  in,
size_t  in_size,
uint8_t *  out,
size_t *  out_pos,
size_t  out_size 
)

Single-call .xz Stream encoding using a preset number.

The maximum required output buffer size can be calculated with lzma_stream_buffer_bound().

Parameters
presetCompression preset to use. See the description in lzma_easy_encoder().
checkType of the integrity check to calculate from uncompressed data.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_sizeSize of the input buffer
outBeginning of the output buffer
out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
Returns
- LZMA_OK: Encoding was successful.
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • LZMA_UNSUPPORTED_CHECK
  • LZMA_OPTIONS_ERROR
  • LZMA_MEM_ERROR
  • LZMA_DATA_ERROR
  • LZMA_PROG_ERROR