f85364d5b7f9ddaa5211ba257790839dc3121b44
[perl.git] / cpan / IO-Compress / lib / IO / Compress / Zlib / Constants.pm
1
2 package IO::Compress::Zlib::Constants ;
3
4 use strict ;
5 use warnings;
6 use bytes;
7
8 require Exporter;
9
10 our ($VERSION, @ISA, @EXPORT);
11
12 $VERSION = '2.068';
13
14 @ISA = qw(Exporter);
15
16 @EXPORT= qw(
17
18         ZLIB_HEADER_SIZE
19         ZLIB_TRAILER_SIZE
20
21         ZLIB_CMF_CM_OFFSET
22         ZLIB_CMF_CM_BITS
23         ZLIB_CMF_CM_DEFLATED
24
25         ZLIB_CMF_CINFO_OFFSET
26         ZLIB_CMF_CINFO_BITS 
27         ZLIB_CMF_CINFO_MAX
28
29         ZLIB_FLG_FCHECK_OFFSET
30         ZLIB_FLG_FCHECK_BITS
31
32         ZLIB_FLG_FDICT_OFFSET
33         ZLIB_FLG_FDICT_BITS
34
35         ZLIB_FLG_LEVEL_OFFSET
36         ZLIB_FLG_LEVEL_BITS
37
38         ZLIB_FLG_LEVEL_FASTEST
39         ZLIB_FLG_LEVEL_FAST
40         ZLIB_FLG_LEVEL_DEFAULT
41         ZLIB_FLG_LEVEL_SLOWEST
42
43         ZLIB_FDICT_SIZE
44
45         );
46
47 # Constant names derived from RFC1950
48
49 use constant ZLIB_HEADER_SIZE       => 2;
50 use constant ZLIB_TRAILER_SIZE      => 4;
51
52 use constant ZLIB_CMF_CM_OFFSET     => 0;
53 use constant ZLIB_CMF_CM_BITS       => 0xF ; # 0b1111
54 use constant ZLIB_CMF_CM_DEFLATED   => 8;
55
56 use constant ZLIB_CMF_CINFO_OFFSET  => 4;
57 use constant ZLIB_CMF_CINFO_BITS    => 0xF ; # 0b1111;
58 use constant ZLIB_CMF_CINFO_MAX     => 7;
59
60 use constant ZLIB_FLG_FCHECK_OFFSET => 0;
61 use constant ZLIB_FLG_FCHECK_BITS   => 0x1F ; # 0b11111;
62
63 use constant ZLIB_FLG_FDICT_OFFSET  => 5;
64 use constant ZLIB_FLG_FDICT_BITS    => 0x1 ; # 0b1;
65
66 use constant ZLIB_FLG_LEVEL_OFFSET  => 6;
67 use constant ZLIB_FLG_LEVEL_BITS    => 0x3 ; # 0b11;
68
69 use constant ZLIB_FLG_LEVEL_FASTEST => 0;
70 use constant ZLIB_FLG_LEVEL_FAST    => 1;
71 use constant ZLIB_FLG_LEVEL_DEFAULT => 2;
72 use constant ZLIB_FLG_LEVEL_SLOWEST => 3;
73
74 use constant ZLIB_FDICT_SIZE        => 4;
75
76
77 1;