INITIALIZATION CLen := nil; CTable := nil; Right := nil; Left := nil; Buffer := nil; Heap := nil; END.
{******************************** Test Program ********************************} { The following simple program can be used for testing the LH5Unit. It compresses/expands files compatible with LHArc. } program Testlh5;
uses WinCRT, SysUtils, Classes, Lh5Unit;
var InStr, OutStr: TFileStream;
begin IF NOT (ParamCount IN [2..3]) THEN BEGIN Writeln(''''Usage :''''); Writeln(''''To compress infile into outfile : LH5 infile outfile''''); Writeln(''''To expand infile into outfile : LH5 infile outfile E''''); HALT; END; InStr := TFileStream.Create(Paramstr(1),fmOpenRead); OutStr := TFileStream.Create(Paramstr(2),fmCreate); IF ParamCount=2 THEN LHACompress(InStr, OutStr) ELSE LHAExpand(InStr, OutStr); InStr.Free; OutStr.Free; end.