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