1
%% ``The contents of this file are subject to the Erlang Public License,
2
%% Version 1.1, (the "License"); you may not use this file except in
3
%% compliance with the License. You should have received a copy of the
4
%% Erlang Public License along with this software. If not, it can be
5
%% retrieved via the world wide web at http://www.erlang.org/.
7
%% Software distributed under the License is distributed on an "AS IS"
8
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
%% the License for the specific language governing rights and limitations
12
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
%% AB. All Rights Reserved.''
19
%% ZIP-file format records and defines
21
%% compression methods
23
-define(UNCOMPRESSED, 0).
25
-define(REDUCED_1, 2).
26
-define(REDUCED_2, 3).
27
-define(REDUCED_3, 4).
28
-define(REDUCED_4, 5).
30
-define(TOKENIZED, 7).
32
-define(DEFLATED_64, 9).
33
-define(PKWARE_IMPLODED, 10).
34
-define(PKWARE_RESERVED, 11).
35
-define(BZIP2_COMPRESSED, 12).
38
-define(LOCAL_FILE_MAGIC,16#04034b50).
39
-define(LOCAL_FILE_HEADER_SZ,(4+2+2+2+2+2+4+4+4+2+2)).
40
-define(LOCAL_FILE_HEADER_CRC32_OFFSET, 4+2+2+2+2+2).
41
-record(local_file_header, {version_needed,
52
-define(CENTRAL_FILE_HEADER_SZ,(4+2+2+2+2+2+2+4+4+4+2+2+2+2+2+4+4)).
54
-define(CENTRAL_DIR_MAGIC, 16#06054b50).
55
-define(CENTRAL_DIR_SZ, (4+2+2+2+2+4+4+2)).
56
-define(CENTRAL_DIR_DIGITAL_SIG_MAGIC, 16#05054b50).
57
-define(CENTRAL_DIR_DIGITAL_SIG_SZ, (4+2)).
59
-define(CENTRAL_FILE_MAGIC, 16#02014b50).
61
-record(cd_file_header, {version_made_by,
76
local_header_offset}).
78
%% Unix extra fields (not yet supported)
79
-define(UNIX_EXTRA_FIELD_TAG, 16#000d).
80
-record(unix_extra_field, {atime,
85
%% extended timestamps (not yet supported)
86
-define(EXTENDED_TIMESTAMP_TAG, 16#5455).
87
-record(extended_timestamp, {mtime,
91
-define(END_OF_CENTRAL_DIR_MAGIC, 16#06054b50).
92
-define(END_OF_CENTRAL_DIR_SZ, (4+2+2+2+2+4+4+2)).
94
-record(eocd, {disk_num,
100
zip_comment_length}).