Unit ChiefLZ |
CHIEFLZ UNIT/DLL, by Dr A Olowofoyeku (the African Chief); internet: laa12@cc.keele.ac.uk http://ourworld.compuserve.com/homepages/African_Chief/chief.htm Version 1.00. USES the original LZSSUNIT source, as amended by the Chief, and Chris J Rankin. Ported to Win32 (Delphi 2.0) by Chris Rankin. // -----------------------------------------------------------// * 16-bit ASM functions converted to 32-bit ASM by Chris J Rankin * Win32 (Delphi 2.0) code: added by Chris J Rankin Package assembled together: 5th September 1996. The routines in this package are already being used in some famous programs! {----------------------------------------------------------------------} {to compile to a DLL in Delphi you need to rename this with the extension .DPR} {$I LZDefine.inc} {// defines various things, including "aDLL" //
Classes |
Functions |
Compress - point to function to ask question if the target file exists
already - if nothing is set, then existing target files will
be overwritten automatically} {$endif
Decompress - compress the source file >> target file
Done - you can init with source and target file names,
or with blanks - so set the source and target file names
later
GetChiefLZArchiveInfo - if LZ file then return uncompressed size - else
return actual filesize.
GetChiefLZArchiveSize - if LZ-Archive then this function returns True, with the header info
in Header.
GetChiefLZFileName - is this an LZ archive file compressed with this unit?
/////////////////////////////////////////////////////////} {$ifdef Win32
GetChiefLZFileSize - if LZ file, then return name (in dest, if not Win32) - else return
fname (in dest, if not Win32)
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
GetFullLZName - decompress the file aName, obtaining the output name from
the header automatically
If target file exists, and autoreplace=false then the
function exits and returns -100 else the target file
will be overwritten
/////////////////////////////////////////////////////////
IsChiefLZArchive - De-Arc a ChiefLZ archive
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////}
These are the LZ functions exported from the unit
{/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
IsChiefLZFile - This functione is used for decompression.
LZArchive - is this an LZ file compressed with this unit?
/////////////////////////////////////////////////////////
LZCompress - ////////////////////////////////////////////////////} {////////////////////////////////////////////////////} {exported INTERFACE functions} {$ifNDef aDLL
/////////////////////////////////////////////////////////
LZCompressEx - If ArchName is LZArchive, returns sum of uncompressed file-sizes in archive.
LZDearchive - archive all the files matching "fSpec" into archive "ArchName";
fSpec = a filespec (e.
LZDecompress - This Function is used for compression.
LZDecompressEx - compress the file aName, and use the filename,
with the last character replaced by a '~' as the output file
If target file exists, and autoreplace=false then the
function exits and returns -100 else the target file
will be overwritten
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
SetInputName -
SetOutputName - set source file name; absolutely necessary
SetQuestionProc - point to procedure to report progress
SetReportProc - set target file name = if empty, then a default one
will be used
Types |
Constants |
Variables |
Functions |
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////} {$ifdef Win32
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////} These are the LZ functions exported from the unit {/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
LZDecompress } {/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
LZCompress } {/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////} {/////////////////////////////////////////////////////////
Types |
LZObj= Object{$Endif Delphi} Constructor Init {$endif}(Const InfName, OutFName:String)last char in filenames created automatically} {////////////////////////////////////////////////////} {////////////////////////////////////////////////////} {////////////////////////////////////////////////////} {Pascal object encapsulating the functionality of this unit - CANNOT BE EXPORTED BY DLL} {////////////////////////////////////////////////////} {////////////////////////////////////////////////////} {$ifndef aDLL
Constants |
Variables |