XZ Utils 5.3.5beta
|
Decodes .lz (lzip) files. More...
Data Structures | |
struct | lzma_lzip_coder |
Macros | |
#define | LZIP_V0_FOOTER_SIZE 12 |
#define | LZIP_V1_FOOTER_SIZE 20 |
#define | LZIP_FOOTER_SIZE_MAX LZIP_V1_FOOTER_SIZE |
#define | LZIP_LC 3 |
#define | LZIP_LP 0 |
#define | LZIP_PB 2 |
Functions | |
static lzma_ret | lzip_decode (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 | lzip_decoder_end (void *coder_ptr, const lzma_allocator *allocator) |
static lzma_check | lzip_decoder_get_check (const void *coder_ptr lzma_attribute((__unused__))) |
static lzma_ret | lzip_decoder_memconfig (void *coder_ptr, uint64_t *memusage, uint64_t *old_memlimit, uint64_t new_memlimit) |
lzma_ret | lzma_lzip_decoder_init (lzma_next_coder *next, const lzma_allocator *allocator, uint64_t memlimit, uint32_t flags) |
lzma_ret | lzma_lzip_decoder (lzma_stream *strm, uint64_t memlimit, uint32_t flags) |
Initialize .lz (lzip) decoder (a foreign file format) More... | |
Decodes .lz (lzip) files.
lzma_ret lzma_lzip_decoder | ( | lzma_stream * | strm, |
uint64_t | memlimit, | ||
uint32_t | flags | ||
) |
Initialize .lz (lzip) decoder (a foreign file format)
strm | Pointer to properly prepared lzma_stream |
memlimit | Memory usage limit as bytes. Use UINT64_MAX to effectively disable the limiter. |
flags | Bitwise-or of flags, or zero for no flags. All decoder flags listed above are supported although only LZMA_CONCATENATED and (in very rare cases) LZMA_IGNORE_CHECK are actually useful. LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_FAIL_FAST do nothing. LZMA_TELL_ANY_CHECK is supported for consistency only as CRC32 is always used in the .lz format. |
This decoder supports the .lz format version 0 and the unextended .lz format version 1:
Just like with lzma_stream_decoder() for .xz files, LZMA_CONCATENATED should be used when decompressing normal standalone .lz files.
The .lz format allows putting non-.lz data at the end of a file after at least one valid .lz member. That is, one can append custom data at the end of a .lz file and the decoder is required to ignore it. In liblzma this is relevant only when LZMA_CONCATENATED is used. In that case lzma_code() will return LZMA_STREAM_END and leave lzma_stream.next_in pointing to the first byte of the non-.lz data. An exception to this is if the first 1-3 bytes of the non-.lz data are identical to the .lz magic bytes (0x4C, 0x5A, 0x49, 0x50; "LZIP" in US-ASCII). In such a case the 1-3 bytes will have been ignored by lzma_code(). If one wishes to locate the non-.lz data reliably, one must ensure that the first byte isn't 0x4C. Actually one should ensure that none of the first four bytes of trailing data are equal to the magic bytes because lzip >= 1.20 requires it by default.
References lzma_next_strm_init.