LzmaUncompress

Syntax

#include <cafe.h>
#include <lzmalib.h>

MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src,
			 SizeT *srcLen, const unsigned char *props, size_t propsSize);

Parameters

dest Output data.
destLen In: output data size.
Out: processed output size.
src Input data.
srcLen In: Input data size.
Out: processed input size.
props Pointer to a 5-byte buffer containing the LZMA compression properties from LzmaCompress.
Offset Size Description
0 1 lc, lb, and pb in encoded form.
1 4 dictSize (in little-endian order).
propsSize Size of properties in props buffer; propsSize = LZMA_PROPS_SIZE = 5.

Return Values

SZ_OK OK.
SZ_ERROR_DATA Data error.
SZ_ERROR_MEM Memory allocation error.
SZ_UNSUPPORTED Unsupported properties.
SZ_ERROR_INPUT_EOF Input src is too short.

Description

Decompress the data referenced by src into the buffer referenced by dest using the LZMA decompression algorithm from the public domain LZMALIB version 9.20 that is available at www.7-zip.org (http://www.7-zip.org/download.html).

Memory Requirements

For decompression, dictSize + state_size is required, where state_size = (4 + (1.5 << (lc + lp))) KB. By default (lc=3, lp=0), state_size = 16 KB.

Demo

There is a demonstration of the usage of compression and decompression in the demo folder:

$CAFE_ROOT/system/src/demo/uselzma

A demonstration involving the parsing and extraction from a 7-Zip file created in Windows is in the demo folder:

$CAFE_ROOT/system/src/demo/szfile

Do Not Call From

None.

See Also

LzmaCompress

Revision History

2014/11/07 Initial version.


CONFIDENTIAL