1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>CXCompressLZ</title> 9<LINK rel="stylesheet" href="../CSS/revolution.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">CXCompressLZ</h1> 15<h2>C Specification</h2> 16 17<dl> 18 <dd> 19<CODE>#include <revolution/cx.h></CODE><BR> <BR> <CODE>u32 CXCompressLZ( const u8 *srcp, u32 size, u8 *dstp, void* work );<BR></CODE></dd> 20</dl> 21<h2>Arguments</h2> 22<TABLE border="1" width="100%"> 23 <TBODY> 24 <TR> 25<TD width="13%"><EM><STRONG>srcp</STRONG></EM></TD> 26<TD width="87%">The source address where the data to compress is stored.</TD> 27 </TR> 28 <TR> 29<TD><EM><STRONG>size</STRONG></EM></TD> 30<TD>The data size of the source to compress.</TD> 31 </TR> 32 <TR> 33<TD width="13%"><EM><STRONG>dstp</STRONG></EM></TD> 34<TD width="87%">Needs a pointer to the compression destination buffer and a region greater than the source data size. Needs a 4-byte alignment.</TD> 35 </TR> 36 <TR> 37<TD><EM><STRONG>work</STRONG></EM></TD> 38<TD>Temporary work buffer used for compression. It requires CX_LZ_COMPRESS_WORK_SIZE bytes in size.</TD> 39 </TR> 40 </TBODY> 41</TABLE> 42 43<h2>Return Values</h2> 44<p>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.</p> 45 46<H2>Description</H2> 47<P>Performs 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.<BR> <A href="CXCompressLZEX.html">CXCompressLZEx</A> generally provides for greater compression. This function is retained for the sake of backwards compatibility and exchange of data with the DS. <BR> This is the same as running the <A href="../tools/ntcompress.html">ntrompress</A> tool with the <CODE>-l</CODE> option. 48 49 50<h2>See Also</h2> 51<p><A href="CXGetUncompressedSize.html"><CODE>CXGetUncompressedSize</CODE></A>, <A href="CXUncompressLZ.html"><CODE>CXUncompressLZ</CODE></A>, <A href="CXSecureUncompressLZ.html"><CODE>CXSecureUncompressLZ</CODE></A>, <A href="CXInitUncompContextLZ.html"><CODE>CXInitUncompContextLZ</CODE></A>, <A href="CXReadUncompLZ.html"><CODE>CXReadUncompLZ</CODE></A>, <A href="CXIsFinishedUncompLZ.html"><CODE>CXIsFinishedUncompLZ</CODE></A>, <A href="CXCompressLZEX.html"><CODE>CXCompressLZEX</CODE></A>, <A href="../tools/ntcompress.html"><CODE>ntrompress</CODE></A></p> 52 53<H2>Revision History</H2> 54<P>2006/07/06 Initial version.</P> 55</body> 56</html> 57