Unit UnZipLib

Classes

TCustomZipStream - This stuff only slightly modified from TCustomMemoryStream, except that all the write functionality has gone { TCustomZipStream
TZipFile - point to header in memory
TZipStream - TZipStream

Functions

Types

cdir_file_hdr
ecdir_rec
ec_byte_rec
PLocalFileHdr
TLocalFileHdr
TPKSearchRecord

Constants

CENTRAL_HDR_SIG
CREC_SIZE
ECREC_SIZE
END_CENTRAL_SIG
LOCAL_HDR_SIG
LREC_SIZE
max_file_path

Variables


Functions


Types


cdir_file_hdr = record
version_made_by : array [0..1] of Byte;
version_needed_to_extract : array [0..1] of Byte;
general_purpose_bit_flag : Word;
compression_method : Word;
last_mod_file_time : Word;
last_mod_file_date : Word;
crc32 : Longint;
csize : Longint;
ucsize : Longint;
filename_length : Word;
extra_field_length : Word;
file_comment_length : Word;
disk_number_start : Word;
internal_file_attributes : Word;
external_file_attributes : Longint;
relative_offset_local_header : Longint;
end;
this stuff isn't used yet, but might be for later versions
ecdir_rec = record
number_this_disk : Word;
num_disk_start_cdir : Word;
num_entries_centrl_dir_ths_disk : Word;
total_entries_central_dir : Word;
size_central_directory : Longint;
offset_start_central_directory : Longint;
zipfile_comment_length : Word;
end;

ec_byte_rec = record
signature : Longint;
number_this_disk : Word;
num_entries_central_dir_ths_disk : Word;
total_entries_central_dir : Word;
size_central_directory : Longint;
offset_start_central_directory : Longint;
zipfile_comment_length : Word;
end;

PLocalFileHdr = ^TLocalFileHdr
central-dir record, respectively
TLocalFileHdr = record
version_needed_to_extract : array [0..1] of Byte;
general_purpose_bit_flag : Word;
compression_method : Word;
last_mod_file_time : Word;
last_mod_file_date : Word;
crc32 : Longint;
csize : Longint;
ucsize : Longint;
filename_length : Word;
extra_field_length : Word;
end;

TPKSearchRecord = record
pk_check_field : array [0..1] of char;
pk_signature : Word;
local : TLocalFileHdr;
local_file_name : array [0..max_file_path] of char;
header_base : Pointer;
end;
should pick up a proper definition of this... combined type for reading file header records and searching in a FindFirst, FindNext sequence

Constants

CENTRAL_HDR_SIG = $0201

CREC_SIZE = 42

lengths of local file headers, central

ECREC_SIZE = 18

directory headers, and the end-of-

END_CENTRAL_SIG = $0605

sans "PK" (so unzip executable not

LOCAL_HDR_SIG = $0403

the infamous "PK" signature bytes,

LREC_SIZE = 26

True sizes of the various headers, as defined by PKWARE -- so it is not likely that these will ever change. But if they do, make sure both these defines AND the typedefs below get updated accordingly.

max_file_path = 127

mistaken for zipfile itself

Variables