Functions

/tmp/buildd/xz-utils-5.0.0/src/liblzma/common/stream_buffer_decoder.c File Reference

Single-call .xz Stream decoder. More...

#include "stream_decoder.h"

Functions

lzma_ret lzma_stream_buffer_decode (uint64_t *memlimit, uint32_t flags, lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size)
 Single-call .xz Stream decoder.

Detailed Description

Single-call .xz Stream decoder.


Function Documentation

lzma_ret lzma_stream_buffer_decode ( uint64_t *  memlimit,
uint32_t  flags,
lzma_allocator allocator,
const uint8_t *  in,
size_t *  in_pos,
size_t  in_size,
uint8_t *  out,
size_t *  out_pos,
size_t  out_size 
)

Single-call .xz Stream decoder.

Parameters:
memlimit Pointer to how much memory the decoder is allowed to allocate. The value pointed by this pointer is modified if and only if LZMA_MEMLIMIT_ERROR is returned.
flags Bitwise-or of zero or more of the decoder flags: LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, LZMA_CONCATENATED. Note that LZMA_TELL_ANY_CHECK is not allowed and will return LZMA_PROG_ERROR.
allocator lzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
in Beginning of the input buffer
in_pos The next byte will be read from in[*in_pos]. *in_pos is updated only if decoding succeeds.
in_size Size of the input buffer; the first byte that won't be read is in[in_size].
out Beginning of the output buffer
out_pos The next byte will be written to out[*out_pos]. *out_pos is updated only if decoding succeeds.
out_size Size of the out buffer; the first byte into which no data is written to is out[out_size].
Returns:
- LZMA_OK: Decoding was successful.
  • LZMA_FORMAT_ERROR
  • LZMA_OPTIONS_ERROR
  • LZMA_DATA_ERROR
  • LZMA_NO_CHECK: This can be returned only if using the LZMA_TELL_NO_CHECK flag.
  • LZMA_UNSUPPORTED_CHECK: This can be returned only if using the LZMA_TELL_UNSUPPORTED_CHECK flag.
  • LZMA_MEM_ERROR
  • LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. The minimum required memlimit value was stored to *memlimit.
  • LZMA_BUF_ERROR: Output buffer was too small.
  • LZMA_PROG_ERROR

References lzma_next_coder_s::code, lzma_next_coder_s::coder, LZMA_FINISH, LZMA_OK, LZMA_STREAM_END, LZMA_TELL_ANY_CHECK, and lzma_next_coder_s::memconfig.