| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package IO::Compress::Lzf ; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 10 |  |  | 10 |  | 36527 | use strict ; | 
|  | 10 |  |  |  |  | 73 |  | 
|  | 10 |  |  |  |  | 2527 |  | 
| 4 | 10 |  |  | 10 |  | 66 | use warnings; | 
|  | 10 |  |  |  |  | 23 |  | 
|  | 10 |  |  |  |  | 341 |  | 
| 5 |  |  |  |  |  |  | require Exporter ; | 
| 6 | 10 |  |  | 10 |  | 5285 | use bytes; | 
|  | 10 |  |  |  |  | 128 |  | 
|  | 10 |  |  |  |  | 53 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 10 |  |  | 10 |  | 5646 | use IO::Compress::Base 2.205 ; | 
|  | 10 |  |  |  |  | 236357 |  | 
|  | 10 |  |  |  |  | 576 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 10 |  |  | 10 |  | 82 | use IO::Compress::Base::Common  2.205 qw(createSelfTiedObject); | 
|  | 10 |  |  |  |  | 139 |  | 
|  | 10 |  |  |  |  | 658 |  | 
| 11 | 10 |  |  | 10 |  | 4819 | use IO::Compress::Adapter::Lzf  2.205 ; | 
|  | 10 |  |  |  |  | 203 |  | 
|  | 10 |  |  |  |  | 5040 |  | 
| 12 |  |  |  |  |  |  | #use Compress::Lzf ; | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $LzfError); | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | $VERSION = '2.205'; | 
| 17 |  |  |  |  |  |  | $LzfError = ''; | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | @ISA    = qw( IO::Compress::Base Exporter ); | 
| 20 |  |  |  |  |  |  | @EXPORT_OK = qw( $LzfError lzf ) ; | 
| 21 |  |  |  |  |  |  | %EXPORT_TAGS = %IO::Compress::Base::EXPORT_TAGS ; | 
| 22 |  |  |  |  |  |  | push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; | 
| 23 |  |  |  |  |  |  | Exporter::export_ok_tags('all'); | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | sub new | 
| 26 |  |  |  |  |  |  | { | 
| 27 | 120 |  |  | 120 | 1 | 1187208 | my $class = shift ; | 
| 28 |  |  |  |  |  |  |  | 
| 29 | 120 |  |  |  |  | 501 | my $obj = createSelfTiedObject($class, \$LzfError); | 
| 30 | 120 |  |  |  |  | 5140 | return $obj->_create(undef, @_); | 
| 31 |  |  |  |  |  |  | } | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | sub lzf | 
| 34 |  |  |  |  |  |  | { | 
| 35 | 130 |  |  | 130 | 1 | 242910 | my $obj = createSelfTiedObject(undef, \$LzfError); | 
| 36 | 130 |  |  |  |  | 5687 | return $obj->_def(@_); | 
| 37 |  |  |  |  |  |  | } | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | sub mkHeader | 
| 40 |  |  |  |  |  |  | { | 
| 41 | 220 |  |  | 220 | 0 | 14106 | my $self = shift ; | 
| 42 | 220 |  |  |  |  | 369 | my $param = shift ; | 
| 43 |  |  |  |  |  |  |  | 
| 44 | 220 |  |  |  |  | 558 | return ''; | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | } | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | sub ckParams | 
| 49 |  |  |  |  |  |  | { | 
| 50 | 222 |  |  | 222 | 0 | 46852 | my $self = shift ; | 
| 51 | 222 |  |  |  |  | 342 | my $got = shift; | 
| 52 |  |  |  |  |  |  |  | 
| 53 | 222 |  |  |  |  | 443 | return 1 ; | 
| 54 |  |  |  |  |  |  | } | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | sub mkComp | 
| 58 |  |  |  |  |  |  | { | 
| 59 | 221 |  |  | 221 | 0 | 5160 | my $self = shift ; | 
| 60 | 221 |  |  |  |  | 337 | my $got = shift ; | 
| 61 |  |  |  |  |  |  |  | 
| 62 | 221 |  |  |  |  | 487 | my ($obj, $errstr, $errno) =  IO::Compress::Adapter::Lzf::mkCompObject( | 
| 63 |  |  |  |  |  |  | $got->getValue('blocksize'), | 
| 64 |  |  |  |  |  |  | ); | 
| 65 |  |  |  |  |  |  |  | 
| 66 | 221 | 50 |  |  |  | 652 | return $self->saveErrorString(undef, $errstr, $errno) | 
| 67 |  |  |  |  |  |  | if ! defined $obj; | 
| 68 |  |  |  |  |  |  |  | 
| 69 | 221 |  |  |  |  | 717 | return $obj; | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | } | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | sub mkTrailer | 
| 75 |  |  |  |  |  |  | { | 
| 76 | 220 |  |  | 220 | 0 | 3643 | my $self = shift ; | 
| 77 | 220 |  |  |  |  | 511 | return ""; | 
| 78 |  |  |  |  |  |  | } | 
| 79 |  |  |  |  |  |  |  | 
| 80 |  |  |  |  |  |  | sub mkFinalTrailer | 
| 81 |  |  |  |  |  |  | { | 
| 82 | 220 |  |  | 220 | 0 | 6242 | my $self = shift ; | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | # If nothing written at all, need to create an zero-length block | 
| 85 |  |  |  |  |  |  | return 'ZV'. pack("Cn", 0, 0) | 
| 86 | 220 | 100 |  |  |  | 651 | if *$self->{Compress}->uncompressedBytes() == 0 ; | 
| 87 |  |  |  |  |  |  |  | 
| 88 | 152 |  |  |  |  | 413 | return ''; | 
| 89 |  |  |  |  |  |  | } | 
| 90 |  |  |  |  |  |  |  | 
| 91 |  |  |  |  |  |  | #sub newHeader | 
| 92 |  |  |  |  |  |  | #{ | 
| 93 |  |  |  |  |  |  | #    my $self = shift ; | 
| 94 |  |  |  |  |  |  | #    return ''; | 
| 95 |  |  |  |  |  |  | #} | 
| 96 |  |  |  |  |  |  |  | 
| 97 |  |  |  |  |  |  | our %PARAMS = ( | 
| 98 |  |  |  |  |  |  | 'blocksize' => [IO::Compress::Base::Common::Parse_unsigned,  (64* 1024) - 1], | 
| 99 |  |  |  |  |  |  | ); | 
| 100 |  |  |  |  |  |  |  | 
| 101 |  |  |  |  |  |  | sub getExtraParams | 
| 102 |  |  |  |  |  |  | { | 
| 103 | 222 |  |  | 222 | 0 | 23592 | return %PARAMS ; | 
| 104 |  |  |  |  |  |  | } | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | sub getInverseClass | 
| 107 |  |  |  |  |  |  | { | 
| 108 | 0 |  |  | 0 | 0 |  | return ('IO::Uncompress::UnLzf'); | 
| 109 |  |  |  |  |  |  | } | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  | 1; | 
| 112 |  |  |  |  |  |  |  | 
| 113 |  |  |  |  |  |  | __END__ |