XZ Utils 5.2.10
Data Structures | Macros | Functions
alone_encoder.c File Reference

Encoder for LZMA_Alone files. More...

#include "common.h"
#include "lzma_encoder.h"

Data Structures

struct  lzma_alone_coder
 

Macros

#define ALONE_HEADER_SIZE   (1 + 4 + 8)
 

Functions

static lzma_ret alone_encode (void *coder_ptr, const lzma_allocator *allocator, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size, lzma_action action)
 
static void alone_encoder_end (void *coder_ptr, const lzma_allocator *allocator)
 
static lzma_ret alone_encoder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_options_lzma *options)
 
lzma_ret lzma_alone_encoder (lzma_stream *strm, const lzma_options_lzma *options)
 Initialize .lzma encoder (legacy file format) More...
 

Detailed Description

Encoder for LZMA_Alone files.

Function Documentation

◆ lzma_alone_encoder()

lzma_ret lzma_alone_encoder ( lzma_stream strm,
const lzma_options_lzma options 
)

Initialize .lzma encoder (legacy file format)

The .lzma format is sometimes called the LZMA_Alone format, which is the reason for the name of this function. The .lzma format supports only the LZMA1 filter. There is no support for integrity checks like CRC32.

Use this function if and only if you need to create files readable by legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format is strongly recommended.

The valid action values for lzma_code() are LZMA_RUN and LZMA_FINISH. No kind of flushing is supported, because the file format doesn't make it possible.

Returns
- LZMA_OK
  • LZMA_MEM_ERROR
  • LZMA_OPTIONS_ERROR
  • LZMA_PROG_ERROR

References lzma_next_strm_init.