Sunteți pe pagina 1din 2

' Search result constants Private Const UNZ_OK = 0 Private Const UNZ_END_OF_LIST_OF_FILE = (-100) ' Open modes Private

Const APPEND_STATUS_CREATE = 0 Private Const APPEND_STATUS_CREATEAFTER = 1 Private Const APPEND_STATUS_ADDINZIP = 2 ' Compression Private Const Private Const Private Const Private Const levels Z_NO_COMPRESSION = 0 Z_BEST_SPEED = 1 Z_BEST_COMPRESSION = 9 Z_DEFAULT_COMPRESSION = (-1)

' The deflate compression method (the only one supported in this version) Private Const Z_DEFLATED = 8 ' Date/time info Private Type TM_ZIP tm_sec As Long tm_min As Long tm_hour As Long tm_mday As Long tm_mon As Long tm_year As Long End Type

' ' ' ' ' '

seconds after the minute - [0,59] minutes after the hour - [0,59] hours since midnight - [0,23] day of the month - [1,31] months since January - [0,11] years - [1980..2044]

' Global data about the ZIPfile that comes from the end of central dir Private Type UNZ_GLOBAL_INFO number_entry As Long ' total number of entries in the central dir on this disk size_comment As Long ' size of the global comment of the zipfile End Type ' Information about a file in the zipfile Private Type UNZ_FILE_INFO version As Long ' version made by version_needed As Long ' version needed to extract flag As Long ' general purpose bit flag compression_method As Long ' compression method dosDate As Long ' last mod file date in Dos fmt crc As Long ' crc-32 compressed_size As Long ' compressed size uncompressed_size As Long ' uncompressed size size_filename As Long ' filename length size_file_extra As Long ' extra field length size_file_comment As Long ' file comment length disk_num_start As Long ' disk number start internal_fa As Long ' internal file attributes external_fa As Long ' external file attributes tmu_date As TM_ZIP End Type

2 2 2 2 4 4 4 4 2 2 2 2 2 4

bytes bytes bytes bytes bytes bytes bytes bytes bytes bytes bytes bytes bytes bytes

' Basic information about the file to be compressed Private Type ZIP_FILEINFO tmz_date As TM_ZIP ' date in understandable format dosDate As Long ' if dos_date == 0, tmu_date is used internal_fa As Long ' internal file attributes 2 bytes

external_fa As Long End Type

' external file attributes

4 bytes

' ZIP Declares Private Declare Function zipOpen Lib "zlibwapi" (ByVal pathname As String, ByVal append As Long) As Long Private Declare Function zipClose Lib "zlibwapi" (ByVal file As Long, ByVal glob al_comment As String) As Long Private Declare Function zipOpenNewFileInZip Lib "zlibwapi" (ByVal file As Long, ByVal fileName As String, zipfi As ZIP_FILEINFO, extrafield_local As Any, ByVal size_extrafield_local As Long, extrafield_global As Any, ByVal size_extrafield_ global As Long, ByVal Comment As String, ByVal method As Long, ByVal level As Lo ng) As Long Private Declare Function zipWriteInFileInZip Lib "zlibwapi" (ByVal file As Long, buf As Any, ByVal bufLen As Long) As Long Private Declare Function zipCloseFileInZip Lib "zlibwapi" (ByVal file As Long) A s Long ' UNZIP Declares Private Declare Function unzOpen Lib "zlibwapi" (ByVal path As String) As Long Private Declare Function unzClose Lib "zlibwapi" (ByVal file As Long) As Long Private Declare Function unzGetGlobalInfo Lib "zlibwapi" (ByVal file As Long, pg lobal_info As UNZ_GLOBAL_INFO) As Long Private Declare Function unzGetGlobalComment Lib "zlibwapi" (ByVal file As Long, ByVal szComment As String, ByVal uSizeBuf As Long) As Long Private Declare Function unzGoToFirstFile Lib "zlibwapi" (ByVal file As Long) As Long Private Declare Function unzGoToNextFile Lib "zlibwapi" (ByVal file As Long) As Long Private Declare Function unzLocateFile Lib "zlibwapi" (ByVal file As Long, ByVal szFileName As String, ByVal iCaseSensitivity As Long) As Long Private Declare Function unzGetCurrentFileInfo Lib "zlibwapi" (ByVal file As Lon g, pfile_info As UNZ_FILE_INFO, ByVal szFileName As String, ByVal fileNameBuffer Size As Long, extraField As Any, ByVal extraFieldBufferSize As Long, ByVal szCom ment As String, ByVal commentBufferSize As Long) As Long Private Declare Function unzOpenCurrentFile Lib "zlibwapi" (ByVal file As Long) As Long Private Declare Function unzOpenCurrentFilePassword Lib "zlibwapi" (ByVal file A s Long, ByVal password As String) As Long Private Declare Function unzCloseCurrentFile Lib "zlibwapi" (ByVal file As Long) As Long Private Declare Function unzReadCurrentFile Lib "zlibwapi" (ByVal file As Long, buf As Any, ByVal bufLen As Long) As Long

S-ar putea să vă placă și