LZMA Decompressor#

LZMA decompressor LZMA is a compression algorithm that is used in the Gecko Bootloader for compressing upgrade images.

It uses dictionary compression algorithm, a variant of LZ77

Functions#

int32_t
decompressAndFlash(ParserContext_t *ctx, const BootloaderParserCallbacks_t *callbacks, bool finish)

Decompress LZMA data and flash.

int32_t
decompressData(uint8_t *dstBuffer, size_t *dstBufferLen, uint8_t *srcBuffer, size_t *srcBufferLen, ELzmaStatus *status)

Decompress LZMA compressed data.

void *
lzmaAlloc(ISzAllocPtr p, size_t size)

LZMA Allocator.

void
lzmaFree(ISzAllocPtr p, void *address)

LZMA Allocator.

Function Documentation#

decompressAndFlash#

int32_t decompressAndFlash (ParserContext_t * ctx, const BootloaderParserCallbacks_t * callbacks, bool finish)

Decompress LZMA data and flash.

Parameters
N/Actx

Parser context

N/Acallbacks

Callbacks to call with parsed data

N/Afinish

Indicates if decompression is complete

Returns

  • Error code


Definition at line 50 of file platform/bootloader/parser/compression/btl_decompress_lzma.h

decompressData#

int32_t decompressData (uint8_t * dstBuffer, size_t * dstBufferLen, uint8_t * srcBuffer, size_t * srcBufferLen, ELzmaStatus * status)

Decompress LZMA compressed data.

Parameters
N/AdstBuffer

Pointer to the destination buffer

N/AdstBufferLen

Size of the destination buffer

N/AsrcBuffer

Pointer to the source buffer

N/AsrcBufferLen

Size of the source buffer

N/Astatus

LZMA status code.

Returns

  • Error code


Definition at line 63 of file platform/bootloader/parser/compression/btl_decompress_lzma.h

lzmaAlloc#

void * lzmaAlloc (ISzAllocPtr p, size_t size)

LZMA Allocator.

Parameters
N/Ap

Pointer to ISzAllocPtr structure instance.

N/Asize

Size of the dictionary buffer


Definition at line 74 of file platform/bootloader/parser/compression/btl_decompress_lzma.h

lzmaFree#

void lzmaFree (ISzAllocPtr p, void * address)

LZMA Allocator.

Parameters
N/Ap

Pointer to ISzAllocPtr structure instance.

N/Aaddress

Pointer to ISzAlloc structure


Definition at line 81 of file platform/bootloader/parser/compression/btl_decompress_lzma.h