CXCompressLZ

Syntax

#include <revolution/cx.h>

u32 CXCompressLZ( const u8 *srcp, u32 size, u8 *dstp, void* work );

Arguments

srcp The source address where the data to compress is stored.
size The data size of the source to compress.
dstp Needs a pointer to the compression destination buffer and a region greater than the source data size. Needs a 4-byte alignment.
work Temporary work buffer used for compression. It requires a size equal to CX_LZ_COMPRESS_WORK_SIZE bytes.

Return Values

Returns the size of the compressed data. If the data after compression is larger than the source file, no compression will be performed and a zero will be returned.

Description

Performs the LZ77 compression on the data then writes it to a specified memory region. A region of the same size as the source data must be prepared in the compression destination buffer.
CXCompressLZEx generally provides for greater compression. This function is retained for the sake of backwards compatibility and exchange of data with the DS.
This is equivalent to running the ntcompress tool with the -l option.

See Also

CXGetUncompressedSize, CXUncompressLZ, CXSecureUncompressLZ, CXInitUncompContextLZ, CXReadUncompLZ, CXIsFinishedUncompLZ, CXCompressLZEx , ntcompress

Revision History

2007/09/03 Corrected errors in the Description and See Also sections.
2006/07/06 Initial version.


CONFIDENTIAL