Documentation for htzdll.dll
----------------------------

The DLL exports a number of high level functions (see below).
Some of these functions can use a callback function, for
progress report, doing some other stuff, etc.

This is the type definition for the callback:
TYPE
htz_CallBack = FUNCTION ( CONST Data; CONST DataSize : Longint ) : Longint stdcall;
{Legend:
 Data     = a buffer containing processed data
 DataSize = the size of that data
 Return value: you should return >= 0 if you want processing to continue,
 	       or a negative value for processing to stop

Example:
Function MyCallBack ( CONST Data; CONST DataSize : Longint ) : Longint;
stdcall;
VAR
p : pchar;
BEGIN
   p := pchar ( @Data );
   p [ DataSize ] := #0;
   WRITE ( p );
   Result := Strlen (p);
END;

}


{ *** high level routines *** }
FUNCTION CompressFile ( Src, Target : pChar) : Longint; stdcall;
{
  Compress a file - parameters are source file and target file
  returns negative value if there is an error, else the number of
  bytes written

Example:
 Result := CompressFile ('adsl.htm', 'adsl.htz');
 
}

FUNCTION CompressFileEx ( Src, Target : pChar; CallBack : htz_CallBack ) : Longint;
stdcall;
{
  Compress a file - with callback functionality

Example:
 Result := CompressFileEx ('adsl.htm', 'adsl.htz', MyCallBackFunc);
 
}


FUNCTION UnCompressFile ( Src, Target : pChar) : Longint; stdcall;
{
  uncompress a file -
  parameters are source file and target file
  returns negative value if there is an error, else the number of
  bytes extracted

Example:
 Result := UnCompressFile ('adsl.htz', 'adsl.htm');
 
}

FUNCTION UnCompressFileEx ( Src, Target : pChar; CallBack : htz_CallBack  ) : Longint;
stdcall;
{
  uncompress a file - with callback functionality

Example:
 Result := UnCompressFileEx ('adsl.htz', 'adsl.htm', MyCallBackFunc);
 
}

FUNCTION IsHTZFile ( FName : pChar ) : Longint; stdcall;
{ rudimentary check for whether a file is an HTZ or other zlib file
  returns > 0 if yes, and <= 0 if not

Example:
  If IsHTZFile ('test.z') > 0 then MessageBox (0, 'Yes!', 'Test', mb_ok);
}

FUNCTION HTZFileSize ( FName : pChar ) : Longint; STDCALL;
{returns the uncompressed size of the HTZ file (if it is one) or
 actual file size

Example:
  If HTZFileSize ('test.z') = FileSize (infile)
    then MessageBox (0, 'This file is not compressed at all', 'test.z', mb_ok);
}


Function htz_Version : pChar; stdcall;
{ returns the version number

Example:
 MessageBox (0, htz_Version, htz_Author, mb_ok)

}

Function htz_Author : pChar; stdcall;
{ returns the package author's name

Example:
 MessageBox (0, htz_Version, htz_Author, mb_ok)

}

Function htz_Date : pChar; stdcall;
{ returns the date of the library

Example:
 MessageBox (0, htz_Version, htz_Date, mb_ok)

}


