minizip lib
Posted: Mon Feb 16, 2009 11:04 pm
This is a static lib + include, providing zip- und unzip-functions for PB4.30 + (windows only)
Different to other libs, this static lib only includes additional functions
to improve the zlib.lib, which is included in the PB-Package, so incompatibly are very unlikely.
This lib supports x86 as well as x64 platforms,
without any necessary changes in the source code being needed.
If you find any bugs, please contact me.
From time to time there will be some increments on this, so any wishes can be told here.
Download
Greetings
Thomas
Different to other libs, this static lib only includes additional functions
to improve the zlib.lib, which is included in the PB-Package, so incompatibly are very unlikely.
This lib supports x86 as well as x64 platforms,
without any necessary changes in the source code being needed.
Code: Select all
*result = ZIP_PackMemory(*source[, sourceLen[, level]])
*source = MemoryPointer
sourceLen = Size of Memory (optional)
level = compressionslevel (optional)
*result = MemoryPointer to packed memory or 0 if failed
result = ZIP_UnpackMemory(*source, *dest)
result = Size of *dest or 0 if failed
void = ZIP_SetPassword([password.s])
password = password for ZIP or UNZIP
result = ZIP_GetFilesCount(Zip_FileName.s)
Zip_FileName.s = filename with path
result = count of files/dirs
result.s = ZIP_GetFileComment(Zip_FileName.s)
Zip_FileName.s = filename with path
result is the global comment of the zipfile
result.s = ZIP_GetFileInfo(Zip_FileName.s, FileNumber[, *FileInfo.unz_file_info])
Zip_FileName.s = filename with path
FileNumber = filenumber in archiv
*FileInfo = stores all infos in the structure (optional)
result = filename
result = ZIP_GetFileNumber(Zip_FileName.s, FileName.s)
Zip_FileName.s = filename with path
FileName = filename with relative path in archiv (not casesensitive)
result = filenumber or 0 if failed
result = ZIP_IsPasswordRequired(Zip_FileName.s, FileNumber)
Zip_FileName.s = filename with path
FileNumber = filenumber in archiv
result = #True, password encrypted, or #False, not password encrypted
result = ZIP_ExtractFile(Zip_FileName.s, FileNumber, Output_Path.s[, CreatePath[, Callback]])
Zip_FileName.s = filename with path
FileNumber = filefumber in archiv
Output_Path.s = path to extract file
CreatePath = #True or #False (#True creates subdirectories in archiv, optional = #True)
Callback = adress of callbackprocedure, Prototyped as: ZIP_PackerCallback(progress)*
*you can return #UNZIP_CANCEL from Callback to cancel
result = #True on success
result = ZIP_ExtractArchiv(Zip_FileName.s, Output_Path.s[, CreatePath[, Callback]])
Zip_FileName.s = filename with path
Output_Path.s = path to extract file
CreatePath = #True or #False (#True creates subdirectories in archiv, optional = #True)
Callback = adress of callbackprocedure, Prototyped as: ZIP_ArchivCallback(progress, files)*
*you can return #UNZIP_CANCEL from Callback to cancel
result = count of extracted files
*result = ZIP_CatchFile(Zip_FileName.s, FileNumber[, Callback])
Zip_FileName.s = filename with path
FileNumber = filenumber in archiv
Callback = adress of callbackprocedure, Prototyped as: ZIP_PackerCallback(progress)*
*you can return #UNZIP_CANCEL from Callback to cancel
*result = memorypointer or 0 if failed
result = ZIP_FileCreate(Zip_FileName.s)
Zip_FileName.s = filename with path
creates a empty zipfile
result = ziphandle or 0 if failed
result = ZIP_FileOpen(FileName.s[, Append_Method])
FileName.s = filename with path (*.*, file must exist!)
Append_Method = #APPEND_STATUS_CREATEAFTER or #APPEND_STATUS_ADDINZIP (optional)
You can add zipfiles to your exe (sfx) or another zipfile
result = ziphandle or 0 if failed
void = ZIP_FileClose(ZipHandle[, Comment.s])
ZipHandle = handle comes as result of ZIP_FileCreate() or ZIP_FileOpen()
Comment = string or textfilename (with path) *.txt! (optional)
no result
result = ZIP_FileAdd(ZipHandle, Filename.s, Archive_Filename.s[, Compression[, Callback]])
ZipHandle = result from ZIP_FileCreate() or ZIP_FileOpen()
Filename.s = filename with path to add to archive
Archive_Filename.s = filename with relative path in archive
Compression = #Z_NO_COMPRESSION or #Z_BEST_SPEED or #Z_BEST_COMPRESSION or #Z_DEFAULT_COMPRESSION (optional)
Callback = adress of callbackprocedure, Prototyped as: ZIP_PackerCallback(progress)*
*you can return #ZIP_CANCEL from Callback to cancel
result = #True on success
result = ZIP_MemAdd(ZipHandle, *source, sourceLen, Archive_Filename.s[, Compression[, Callback]])
ZipHandle = result from ZIP_FileCreate() or ZIP_FileOpen()
*source = memorypointer
sourceLen = memorysize in bytes
Archive_Filename.s = filename with relative path in archive
Compression = #Z_NO_COMPRESSION or #Z_BEST_SPEED or #Z_BEST_COMPRESSION or #Z_DEFAULT_COMPRESSION (optional)
Callback = adress of callbackprocedure, Prototyped as: ZIP_PackerCallback(progress)*
*you can return #ZIP_CANCEL from Callback to cancel
result = #True on success
From time to time there will be some increments on this, so any wishes can be told here.
Download
Greetings
Thomas