function zOpenZipFile(zipfilename : pchar): integer;
stdcall;
This function opens zip file and creates a list of
items, corresponding to contents of zip file. Must be called before any
other function to get access to zip file. ZipFileName is the path
and full name of zip file, for example: 'C:\TEST.ZIP'. Returns zero on
success.
function zCloseZipFile: integer;
stdcall;
Closes zip file, opened with zOpenZipFile.
Returns zero on success.
function zGetTotalFiles : integer;
stdcall;
Returns the total number of compressed files within
zip file, i.e. the number of items in the list. First item has index =
0, last item has index = zGetTotalFiles-1
function zGetTotalBytes : integer;
stdcall;
Returns the sum of uncompressed file size of all
files within zip file.
function zGetSelectedFiles : integer;
stdcall;
Returns the number of currently selected files.
function zGetSelectedBytes : integer;
Returns the sum of uncompressed file size of selected
files within zip file.
function zGetLastErrorAsText : pchar;
stdcall;
If some error occurs in the DLL, this function will
return the string, describing the error.
function zGetSkipedFiles: integer;
stdcall;
After extracting operation, this function will return
the number of skipped files - usually zero.
function zGetRunTimeInfo(var ProcessedFiles,ProcessedBytes
: integer): boolean; stdcall;
This function returns the number of currently processed
files and bytes. This is necessary to calculate position of progress indicator.
Returns true on success.
function zCancelOperation : boolean;
stdcall;
To cancel extract operation, call this function.
function zExtractOne(ItemNo: integer;ExtractDirectory,Password:
pchar;
OverwriteExisting,UseFolders,TestOnly :
boolean;RTInfoFunc: pointer) : integer;
Extracts only one of the file in zip file. This is
useful for viewing/launching files. Parameters are:
ItemNo - Item number of the file in the
list.
0<= ItemNo <= zGetTotalFile-1
ExtractDirectory - Directory where to extract files. If empty, current directory is used.
Password - password to be used, if file is encrypted.
OverwriteExisting - if true, any existing file will be overwritten, otherwise will be skipped.
UseFolders - if true, the relative path information stored in zip file will be used to determine location of the extracting file.
TestOnly - if true, files are only tested, not saved to disk.
RTInfoFunc - pointer to the application function, which will be called periodically from library to show runtime information, for example some kind of progress bar. Within this function, application can call zGetRunTimeInfo or zCancelOperation. If nil, no runtime information will be available.
Return value is zero on success, otherwise application
can call zGetLastErrorAsText to get type of error.
function zExtractSelected(ExtractDirectory,Password:
pchar;
OverwriteExisting,UseFolders,TestOnly :
boolean;RTInfoFunc: pointer) : integer;
stdcall;
Extracts only files in the list, previously selected
by zSelectFile. Parameters are the same as in zExtractOne.
Returns zero on success.
function zExtractAll(ExtractDirectory,Password:
pchar;
OverwriteExisting,UseFolders,TestOnly :
boolean;RTInfoFunc: pointer) : integer;
stdcall;
Extracts all files. Parameters are the same as in
zExtractOne. Returns zero on success.
function zGetFileName(i : integer) : pchar;
stdcall;
Returns the name of the file in the list with index
i.
function zGetFileExt(i : integer) : pchar;
stdcall;
Returns the extension of the file in the list with
index i.
function zGetFilePath(i : integer) : pchar; stdcall;
Returns the stored path of the file in the list with
index i.
function zGetFileDate(i : integer) : integer;
stdcall;
Returns the MSDOS date of the file in the list with
index i.
function zGetFileTime(i : integer) : integer;
stdcall;
Returns the MSDOS time of the file in the list with
index i.
function zGetFileSize(i : integer) : integer;
stdcall;
Returns the uncompressed size of the file in the
list with index i.
function zGetCompressedFileSize(i : integer) :
integer; stdcall;
Returns the compressed size of the file in the list
with index i.
function zFileIsEncrypted(i : integer) : boolean;
stdcall;
Returns true, if file in the list with index i is
encrypted.
function zGetLastOperResult(i : integer) : pchar;
stdcall;
Returns the result of the last operation on the file
in the list with index i. Usually 'Ok.'
function zFileIsSelected(i : integer) : boolean;
stdcall;
Returns true, if file in the list with index i is
selected.
function zSelectFile(i: integer;how : boolean):
boolean; stdcall;
Select/Unselect file in the list with index i. If
how is true, the file will be selected, otherwise will be unselected.
(c) TopSpeedSoft, 1998