Commit | Line | Data |
---|---|---|
25f0751f | 1 | package IO::Compress::Zip::Constants; |
2 | ||
3 | use strict ; | |
4 | use warnings; | |
5 | ||
6 | require Exporter; | |
7 | ||
c70c1701 | 8 | our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS); |
25f0751f | 9 | |
63ad731d | 10 | $VERSION = '2.001'; |
25f0751f | 11 | |
12 | @ISA = qw(Exporter); | |
13 | ||
14 | @EXPORT= qw( | |
15 | ||
2b4e0969 | 16 | ZIP_CM_STORE |
c70c1701 | 17 | ZIP_CM_DEFLATE |
2b4e0969 | 18 | ZIP_CM_BZIP2 |
c70c1701 | 19 | |
20 | ZIP_LOCAL_HDR_SIG | |
21 | ZIP_DATA_HDR_SIG | |
22 | ZIP_CENTRAL_HDR_SIG | |
23 | ZIP_END_CENTRAL_HDR_SIG | |
e7d45986 | 24 | ZIP64_END_CENTRAL_REC_HDR_SIG |
25 | ZIP64_END_CENTRAL_LOC_HDR_SIG | |
26 | ZIP64_ARCHIVE_EXTRA_SIG | |
27 | ZIP64_DIGITAL_SIGNATURE_SIG | |
25f0751f | 28 | |
258133d1 | 29 | ZIP_GP_FLAG_ENCRYPTED_MASK |
c70c1701 | 30 | ZIP_GP_FLAG_STREAMING_MASK |
258133d1 | 31 | ZIP_GP_FLAG_PATCHED_MASK |
32 | ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK | |
25f0751f | 33 | |
e7d45986 | 34 | ZIP_EXTRA_ID_ZIP64 |
c70c1701 | 35 | ZIP_EXTRA_ID_EXT_TIMESTAMP |
36 | ZIP_EXTRA_ID_INFO_ZIP_UNIX | |
25f0751f | 37 | |
c70c1701 | 38 | ZIP_IFA_TEXT_MASK |
25f0751f | 39 | |
c70c1701 | 40 | %ZIP_CM_MIN_VERSIONS |
e7d45986 | 41 | ZIP64_MIN_VERSION |
25f0751f | 42 | |
43 | ); | |
44 | ||
c70c1701 | 45 | # Compression types supported |
46 | use constant ZIP_CM_STORE => 0 ; | |
47 | use constant ZIP_CM_DEFLATE => 8 ; | |
48 | use constant ZIP_CM_BZIP2 => 12 ; | |
25f0751f | 49 | |
c70c1701 | 50 | # General Purpose Flag |
51 | use constant ZIP_GP_FLAG_ENCRYPTED_MASK => 1 ; | |
52 | use constant ZIP_GP_FLAG_STREAMING_MASK => 8 ; | |
258133d1 | 53 | use constant ZIP_GP_FLAG_PATCHED_MASK => 32 ; |
54 | use constant ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK => 64 ; | |
25f0751f | 55 | |
c70c1701 | 56 | # Internal File Attributes |
57 | use constant ZIP_IFA_TEXT_MASK => 1; | |
25f0751f | 58 | |
c70c1701 | 59 | # Signatures for each of the headers |
60 | use constant ZIP_LOCAL_HDR_SIG => 0x04034b50; | |
61 | use constant ZIP_DATA_HDR_SIG => 0x08074b50; | |
62 | use constant ZIP_CENTRAL_HDR_SIG => 0x02014b50; | |
63 | use constant ZIP_END_CENTRAL_HDR_SIG => 0x06054b50; | |
e7d45986 | 64 | use constant ZIP64_END_CENTRAL_REC_HDR_SIG => 0x06064b50; |
65 | use constant ZIP64_END_CENTRAL_LOC_HDR_SIG => 0x07064b50; | |
66 | use constant ZIP64_ARCHIVE_EXTRA_SIG => 0x08064b50; | |
67 | use constant ZIP64_DIGITAL_SIGNATURE_SIG => 0x05054b50; | |
25f0751f | 68 | |
c70c1701 | 69 | # Extra Field ID's |
e7d45986 | 70 | use constant ZIP_EXTRA_ID_ZIP64 => pack "v", 1; |
c70c1701 | 71 | use constant ZIP_EXTRA_ID_EXT_TIMESTAMP => "UT"; |
72 | use constant ZIP_EXTRA_ID_INFO_ZIP_UNIX => "Ux"; | |
25f0751f | 73 | |
e7d45986 | 74 | use constant ZIP64_MIN_VERSION => 45; |
75 | ||
c70c1701 | 76 | %ZIP_CM_MIN_VERSIONS = ( |
77 | ZIP_CM_STORE() => 20, | |
78 | ZIP_CM_DEFLATE() => 20, | |
79 | ZIP_CM_BZIP2() => 46, | |
80 | ); | |
25f0751f | 81 | |
25f0751f | 82 | |
c70c1701 | 83 | 1; |
25f0751f | 84 | |
c70c1701 | 85 | __END__ |
25f0751f | 86 |