PATCH: 2 vms specific build files in perl @ 27383
[p5sagit/p5-mst-13.2.git] / ext / Compress / Zlib / lib / IO / Compress / RawDeflate.pm
CommitLineData
642e522c 1package IO::Compress::RawDeflate ;
2
3# create RFC1951
4#
5use strict ;
6use warnings;
1a6a8453 7
8
9use IO::Compress::Base;
10use CompressPlugin::Deflate ;
642e522c 11
12require Exporter ;
1a6a8453 13use Compress::Zlib::Common qw(:Status createSelfTiedObject);
642e522c 14
642e522c 15
1a6a8453 16our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
17
18$VERSION = '2.000_07';
642e522c 19$RawDeflateError = '';
20
1a6a8453 21@ISA = qw(Exporter IO::Compress::Base);
642e522c 22@EXPORT_OK = qw( $RawDeflateError rawdeflate ) ;
642e522c 23push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
642e522c 24
1a6a8453 25%EXPORT_TAGS = ( flush => [qw{
26 Z_NO_FLUSH
27 Z_PARTIAL_FLUSH
28 Z_SYNC_FLUSH
29 Z_FULL_FLUSH
30 Z_FINISH
31 Z_BLOCK
32 }],
33 level => [qw{
34 Z_NO_COMPRESSION
35 Z_BEST_SPEED
36 Z_BEST_COMPRESSION
37 Z_DEFAULT_COMPRESSION
38 }],
39 strategy => [qw{
40 Z_FILTERED
41 Z_HUFFMAN_ONLY
42 Z_RLE
43 Z_FIXED
44 Z_DEFAULT_STRATEGY
45 }],
46
47 );
48
49{
50 my %seen;
51 foreach (keys %EXPORT_TAGS )
52 {
53 push @{$EXPORT_TAGS{constants}},
54 grep { !$seen{$_}++ }
55 @{ $EXPORT_TAGS{$_} }
56 }
57 $EXPORT_TAGS{all} = $EXPORT_TAGS{constants} ;
58}
59
60%DEFLATE_CONSTANTS = %EXPORT_TAGS;
61
62Exporter::export_ok_tags('all');
63
642e522c 64
65
66sub new
67{
1a6a8453 68 my $class = shift ;
69
70 my $obj = createSelfTiedObject($class, \$RawDeflateError);
71
72 return $obj->_create(undef, @_);
642e522c 73}
74
75sub rawdeflate
76{
1a6a8453 77 my $obj = createSelfTiedObject(undef, \$RawDeflateError);
78 return $obj->_def(@_);
79}
80
81sub ckParams
82{
83 my $self = shift ;
84 my $got = shift;
85
86 return 1 ;
87}
88
89sub mkComp
90{
91 my $self = shift ;
92 my $class = shift ;
93 my $got = shift ;
94
95 #return CompressPlugin::Deflate::mkCompObject($self, $class, $got)
96 my ($obj, $errstr, $errno) = CompressPlugin::Deflate::mkCompObject(
97 $got->value('CRC32'),
98 $got->value('Adler32'),
99 $got->value('Level'),
100 $got->value('Strategy')
101 );
102
103 return $self->saveErrorString(undef, $errstr, $errno)
104 if ! defined $obj;
105
106 return $obj;
107}
108
109
110sub mkHeader
111{
112 my $self = shift ;
113 return '';
114}
115
116sub mkTrailer
117{
118 my $self = shift ;
119 return '';
120}
121
122sub mkFinalTrailer
123{
124 return '';
642e522c 125}
126
1a6a8453 127
128#sub newHeader
129#{
130# my $self = shift ;
131# return '';
132#}
133
134sub getExtraParams
135{
136 my $self = shift ;
137 return $self->getZlibParams();
138}
139
140sub getZlibParams
141{
142 my $self = shift ;
143
144 use Compress::Zlib::ParseParameters;
145 use Compress::Zlib qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
146
147
148 return (
149
150 # zlib behaviour
151 #'Method' => [0, 1, Parse_unsigned, Z_DEFLATED],
152 'Level' => [0, 1, Parse_signed, Z_DEFAULT_COMPRESSION],
153 'Strategy' => [0, 1, Parse_signed, Z_DEFAULT_STRATEGY],
154
155 'CRC32' => [0, 1, Parse_boolean, 0],
156 'ADLER32' => [0, 1, Parse_boolean, 0],
157 'Merge' => [1, 1, Parse_boolean, 0],
158 );
159
160
161}
162
163sub getInverseClass
164{
165 return ('IO::Uncompress::RawInflate',
166 \$IO::Uncompress::RawInflate::RawInflateError);
167}
168
169sub getFileInfo
170{
171 my $self = shift ;
172 my $params = shift;
173 my $file = shift ;
174
175}
176
177use IO::Seekable qw(SEEK_SET);
178
179sub createMerge
180{
181 my $self = shift ;
182 my $outValue = shift ;
183 my $outType = shift ;
184
185 my ($invClass, $error_ref) = $self->getInverseClass();
186 eval "require $invClass"
187 or die "aaaahhhh" ;
188
189 my $inf = $invClass->new( $outValue,
190 Transparent => 0,
191 #Strict => 1,
192 AutoClose => 0,
193 Scan => 1)
194 or return $self->saveErrorString(undef, "Cannot create InflateScan object: $$error_ref" ) ;
195
196 my $end_offset = 0;
197 $inf->scan()
198 or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $inf->errorNo) ;
199 $inf->zap($end_offset)
200 or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $inf->errorNo) ;
201
202 my $def = *$self->{Compress} = $inf->createDeflate();
203
204 *$self->{Header} = *$inf->{Info}{Header};
205 *$self->{UnCompSize_32bit} =
206 *$self->{BytesWritten} = *$inf->{UnCompSize_32bit} ;
207
208
209 if ( $outType eq 'buffer')
210 { substr( ${ *$self->{Buffer} }, $end_offset) = '' }
211 elsif ($outType eq 'handle' || $outType eq 'filename') {
212 *$self->{FH} = *$inf->{FH} ;
213 delete *$inf->{FH};
214 *$self->{FH}->flush() ;
215 *$self->{Handle} = 1 if $outType eq 'handle';
216
217 #seek(*$self->{FH}, $end_offset, SEEK_SET)
218 *$self->{FH}->seek($end_offset, SEEK_SET)
219 or return $self->saveErrorString(undef, $!, $!) ;
220 }
221
222 return $def ;
223}
224
225#### zlib specific methods
226
227sub deflateParams
228{
229 my $self = shift ;
230
231 my $level = shift ;
232 my $strategy = shift ;
233
234 my $status = *$self->{Compress}->deflateParams(Level => $level, Strategy => $strategy) ;
235 return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo})
236 if $status == STATUS_ERROR;
237
238 return 1;
239}
240
241
242
243
642e522c 2441;
245
246__END__
247
248=head1 NAME
249
250IO::Compress::RawDeflate - Perl interface to write RFC 1951 files/buffers
251
252=head1 SYNOPSIS
253
254 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
255
256
257 my $status = rawdeflate $input => $output [,OPTS]
258 or die "rawdeflate failed: $RawDeflateError\n";
259
260 my $z = new IO::Compress::RawDeflate $output [,OPTS]
261 or die "rawdeflate failed: $RawDeflateError\n";
262
263 $z->print($string);
264 $z->printf($format, $string);
265 $z->write($string);
266 $z->syswrite($string [, $length, $offset]);
267 $z->flush();
268 $z->tell();
269 $z->eof();
270 $z->seek($position, $whence);
271 $z->binmode();
272 $z->fileno();
1a6a8453 273 $z->newStream( [OPTS] );
642e522c 274 $z->deflateParams();
275 $z->close() ;
276
277 $RawDeflateError ;
278
279 # IO::File mode
280
281 print $z $string;
282 printf $z $format, $string;
283 syswrite $z, $string [, $length, $offset];
284 flush $z, ;
285 tell $z
286 eof $z
287 seek $z, $position, $whence
288 binmode $z
289 fileno $z
290 close $z ;
291
292
293=head1 DESCRIPTION
294
295
296
297B<WARNING -- This is a Beta release>.
298
299=over 5
300
301=item * DO NOT use in production code.
302
303=item * The documentation is incomplete in places.
304
305=item * Parts of the interface defined here are tentative.
306
307=item * Please report any problems you find.
308
309=back
310
311
312
313This module provides a Perl interface that allows writing compressed
314data to files or buffer as defined in RFC 1951.
315
316
317
318
319Note that RFC1951 data is not a good choice of compression format
320to use in isolation, especially if you want to auto-detect it.
321
322
323For reading RFC 1951 files/buffers, see the companion module
324L<IO::Uncompress::RawInflate|IO::Uncompress::RawInflate>.
325
326
327=head1 Functional Interface
328
1a6a8453 329A top-level function, C<rawdeflate>, is provided to carry out
330"one-shot" compression between buffers and/or files. For finer
331control over the compression process, see the L</"OO Interface">
332section.
642e522c 333
334 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
335
336 rawdeflate $input => $output [,OPTS]
337 or die "rawdeflate failed: $RawDeflateError\n";
338
1a6a8453 339
642e522c 340
341The functional interface needs Perl5.005 or better.
342
343
344=head2 rawdeflate $input => $output [, OPTS]
345
1a6a8453 346
347C<rawdeflate> expects at least two parameters, C<$input> and C<$output>.
642e522c 348
349=head3 The C<$input> parameter
350
351The parameter, C<$input>, is used to define the source of
352the uncompressed data.
353
354It can take one of the following forms:
355
356=over 5
357
358=item A filename
359
360If the C<$input> parameter is a simple scalar, it is assumed to be a
361filename. This file will be opened for reading and the input data
362will be read from it.
363
364=item A filehandle
365
366If the C<$input> parameter is a filehandle, the input data will be
367read from it.
368The string '-' can be used as an alias for standard input.
369
370=item A scalar reference
371
372If C<$input> is a scalar reference, the input data will be read
373from C<$$input>.
374
375=item An array reference
376
1a6a8453 377If C<$input> is an array reference, each element in the array must be a
378filename.
379
380The input data will be read from each file in turn.
381
642e522c 382The complete array will be walked to ensure that it only
1a6a8453 383contains valid filenames before any data is compressed.
384
385
642e522c 386
387=item An Input FileGlob string
388
389If C<$input> is a string that is delimited by the characters "<" and ">"
390C<rawdeflate> will assume that it is an I<input fileglob string>. The
391input is the list of files that match the fileglob.
392
393If the fileglob does not match any files ...
394
395See L<File::GlobMapper|File::GlobMapper> for more details.
396
397
398=back
399
400If the C<$input> parameter is any other type, C<undef> will be returned.
401
402
403
404=head3 The C<$output> parameter
405
406The parameter C<$output> is used to control the destination of the
407compressed data. This parameter can take one of these forms.
408
409=over 5
410
411=item A filename
412
1a6a8453 413If the C<$output> parameter is a simple scalar, it is assumed to be a
414filename. This file will be opened for writing and the compressed
415data will be written to it.
642e522c 416
417=item A filehandle
418
1a6a8453 419If the C<$output> parameter is a filehandle, the compressed data
420will be written to it.
642e522c 421The string '-' can be used as an alias for standard output.
422
423
424=item A scalar reference
425
1a6a8453 426If C<$output> is a scalar reference, the compressed data will be
427stored in C<$$output>.
642e522c 428
642e522c 429
430
431=item An Array Reference
432
1a6a8453 433If C<$output> is an array reference, the compressed data will be
434pushed onto the array.
642e522c 435
436=item An Output FileGlob
437
438If C<$output> is a string that is delimited by the characters "<" and ">"
439C<rawdeflate> will assume that it is an I<output fileglob string>. The
440output is the list of files that match the fileglob.
441
442When C<$output> is an fileglob string, C<$input> must also be a fileglob
443string. Anything else is an error.
444
445=back
446
447If the C<$output> parameter is any other type, C<undef> will be returned.
448
642e522c 449
642e522c 450
451=head2 Notes
452
453When C<$input> maps to multiple files/buffers and C<$output> is a single
1a6a8453 454file/buffer the compressed input files/buffers will all be stored
455in C<$output> as a single compressed stream.
642e522c 456
457
458
459=head2 Optional Parameters
460
461Unless specified below, the optional parameters for C<rawdeflate>,
462C<OPTS>, are the same as those used with the OO interface defined in the
463L</"Constructor Options"> section below.
464
465=over 5
466
467=item AutoClose =E<gt> 0|1
468
1a6a8453 469This option applies to any input or output data streams to
470C<rawdeflate> that are filehandles.
642e522c 471
472If C<AutoClose> is specified, and the value is true, it will result in all
473input and/or output filehandles being closed once C<rawdeflate> has
474completed.
475
476This parameter defaults to 0.
477
478
479
1a6a8453 480=item BinModeIn =E<gt> 0|1
481
482When reading from a file or filehandle, set C<binmode> before reading.
483
484Defaults to 0.
485
486
487
488
489
642e522c 490=item -Append =E<gt> 0|1
491
492TODO
493
494
495=back
496
497
498
499=head2 Examples
500
501To read the contents of the file C<file1.txt> and write the compressed
502data to the file C<file1.txt.1951>.
503
504 use strict ;
505 use warnings ;
506 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
507
508 my $input = "file1.txt";
509 rawdeflate $input => "$input.1951"
510 or die "rawdeflate failed: $RawDeflateError\n";
511
512
513To read from an existing Perl filehandle, C<$input>, and write the
514compressed data to a buffer, C<$buffer>.
515
516 use strict ;
517 use warnings ;
518 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
519 use IO::File ;
520
521 my $input = new IO::File "<file1.txt"
522 or die "Cannot open 'file1.txt': $!\n" ;
523 my $buffer ;
524 rawdeflate $input => \$buffer
525 or die "rawdeflate failed: $RawDeflateError\n";
526
527To compress all files in the directory "/my/home" that match "*.txt"
528and store the compressed data in the same directory
529
530 use strict ;
531 use warnings ;
532 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
533
534 rawdeflate '</my/home/*.txt>' => '<*.1951>'
535 or die "rawdeflate failed: $RawDeflateError\n";
536
537and if you want to compress each file one at a time, this will do the trick
538
539 use strict ;
540 use warnings ;
541 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError) ;
542
543 for my $input ( glob "/my/home/*.txt" )
544 {
545 my $output = "$input.1951" ;
546 rawdeflate $input => $output
547 or die "Error compressing '$input': $RawDeflateError\n";
548 }
549
550
551=head1 OO Interface
552
553=head2 Constructor
554
555The format of the constructor for C<IO::Compress::RawDeflate> is shown below
556
557 my $z = new IO::Compress::RawDeflate $output [,OPTS]
558 or die "IO::Compress::RawDeflate failed: $RawDeflateError\n";
559
560It returns an C<IO::Compress::RawDeflate> object on success and undef on failure.
561The variable C<$RawDeflateError> will contain an error message on failure.
562
563If you are running Perl 5.005 or better the object, C<$z>, returned from
564IO::Compress::RawDeflate can be used exactly like an L<IO::File|IO::File> filehandle.
565This means that all normal output file operations can be carried out
566with C<$z>.
567For example, to write to a compressed file/buffer you can use either of
568these forms
569
570 $z->print("hello world\n");
571 print $z "hello world\n";
572
573The mandatory parameter C<$output> is used to control the destination
574of the compressed data. This parameter can take one of these forms.
575
576=over 5
577
578=item A filename
579
580If the C<$output> parameter is a simple scalar, it is assumed to be a
581filename. This file will be opened for writing and the compressed data
582will be written to it.
583
584=item A filehandle
585
586If the C<$output> parameter is a filehandle, the compressed data will be
587written to it.
588The string '-' can be used as an alias for standard output.
589
590
591=item A scalar reference
592
593If C<$output> is a scalar reference, the compressed data will be stored
594in C<$$output>.
595
596=back
597
598If the C<$output> parameter is any other type, C<IO::Compress::RawDeflate>::new will
599return undef.
600
601=head2 Constructor Options
602
603C<OPTS> is any combination of the following options:
604
605=over 5
606
607=item -AutoClose =E<gt> 0|1
608
609This option is only valid when the C<$output> parameter is a filehandle. If
1a6a8453 610specified, and the value is true, it will result in the C<$output> being
611closed once either the C<close> method is called or the C<IO::Compress::RawDeflate>
612object is destroyed.
642e522c 613
614This parameter defaults to 0.
615
616=item -Append =E<gt> 0|1
617
618Opens C<$output> in append mode.
619
1a6a8453 620The behaviour of this option is dependent on the type of C<$output>.
642e522c 621
622=over 5
623
624=item * A Buffer
625
1a6a8453 626If C<$output> is a buffer and C<Append> is enabled, all compressed data
627will be append to the end if C<$output>. Otherwise C<$output> will be
628cleared before any data is written to it.
642e522c 629
630=item * A Filename
631
1a6a8453 632If C<$output> is a filename and C<Append> is enabled, the file will be
633opened in append mode. Otherwise the contents of the file, if any, will be
634truncated before any compressed data is written to it.
642e522c 635
636=item * A Filehandle
637
1a6a8453 638If C<$output> is a filehandle, the file pointer will be positioned to the
639end of the file via a call to C<seek> before any compressed data is written
640to it. Otherwise the file pointer will not be moved.
642e522c 641
642=back
643
644This parameter defaults to 0.
645
646=item -Merge =E<gt> 0|1
647
648This option is used to compress input data and append it to an existing
649compressed data stream in C<$output>. The end result is a single compressed
650data stream stored in C<$output>.
651
652
653
1a6a8453 654It is a fatal error to attempt to use this option when C<$output> is not an
655RFC 1951 data stream.
642e522c 656
657
658
659There are a number of other limitations with the C<Merge> option:
660
661=over 5
662
663=item 1
664
1a6a8453 665This module needs to have been built with zlib 1.2.1 or better to work. A
666fatal error will be thrown if C<Merge> is used with an older version of
667zlib.
642e522c 668
669=item 2
670
671If C<$output> is a file or a filehandle, it must be seekable.
672
673=back
674
675
676This parameter defaults to 0.
677
678=item -Level
679
680Defines the compression level used by zlib. The value should either be
681a number between 0 and 9 (0 means no compression and 9 is maximum
682compression), or one of the symbolic constants defined below.
683
684 Z_NO_COMPRESSION
685 Z_BEST_SPEED
686 Z_BEST_COMPRESSION
687 Z_DEFAULT_COMPRESSION
688
689The default is Z_DEFAULT_COMPRESSION.
690
691Note, these constants are not imported by C<IO::Compress::RawDeflate> by default.
692
693 use IO::Compress::RawDeflate qw(:strategy);
694 use IO::Compress::RawDeflate qw(:constants);
695 use IO::Compress::RawDeflate qw(:all);
696
697=item -Strategy
698
699Defines the strategy used to tune the compression. Use one of the symbolic
700constants defined below.
701
702 Z_FILTERED
703 Z_HUFFMAN_ONLY
704 Z_RLE
705 Z_FIXED
706 Z_DEFAULT_STRATEGY
707
708The default is Z_DEFAULT_STRATEGY.
709
710
711
712
713
714=item -Strict =E<gt> 0|1
715
716
717
718This is a placeholder option.
719
720
721
722=back
723
724=head2 Examples
725
726TODO
727
728=head1 Methods
729
730=head2 print
731
732Usage is
733
734 $z->print($data)
735 print $z $data
736
737Compresses and outputs the contents of the C<$data> parameter. This
1a6a8453 738has the same behaviour as the C<print> built-in.
642e522c 739
740Returns true if successful.
741
742=head2 printf
743
744Usage is
745
746 $z->printf($format, $data)
747 printf $z $format, $data
748
749Compresses and outputs the contents of the C<$data> parameter.
750
751Returns true if successful.
752
753=head2 syswrite
754
755Usage is
756
757 $z->syswrite $data
758 $z->syswrite $data, $length
759 $z->syswrite $data, $length, $offset
760
761 syswrite $z, $data
762 syswrite $z, $data, $length
763 syswrite $z, $data, $length, $offset
764
765Compresses and outputs the contents of the C<$data> parameter.
766
767Returns the number of uncompressed bytes written, or C<undef> if
768unsuccessful.
769
770=head2 write
771
772Usage is
773
774 $z->write $data
775 $z->write $data, $length
776 $z->write $data, $length, $offset
777
778Compresses and outputs the contents of the C<$data> parameter.
779
780Returns the number of uncompressed bytes written, or C<undef> if
781unsuccessful.
782
783=head2 flush
784
785Usage is
786
787 $z->flush;
788 $z->flush($flush_type);
789 flush $z ;
790 flush $z $flush_type;
791
792Flushes any pending compressed data to the output file/buffer.
793
794This method takes an optional parameter, C<$flush_type>, that controls
795how the flushing will be carried out. By default the C<$flush_type>
796used is C<Z_FINISH>. Other valid values for C<$flush_type> are
797C<Z_NO_FLUSH>, C<Z_SYNC_FLUSH>, C<Z_FULL_FLUSH> and C<Z_BLOCK>. It is
798strongly recommended that you only set the C<flush_type> parameter if
799you fully understand the implications of what it does - overuse of C<flush>
800can seriously degrade the level of compression achieved. See the C<zlib>
801documentation for details.
802
803Returns true on success.
804
805
806=head2 tell
807
808Usage is
809
810 $z->tell()
811 tell $z
812
813Returns the uncompressed file offset.
814
815=head2 eof
816
817Usage is
818
819 $z->eof();
820 eof($z);
821
822
823
824Returns true if the C<close> method has been called.
825
826
827
828=head2 seek
829
830 $z->seek($position, $whence);
831 seek($z, $position, $whence);
832
833
834
835
836Provides a sub-set of the C<seek> functionality, with the restriction
837that it is only legal to seek forward in the output file/buffer.
838It is a fatal error to attempt to seek backward.
839
840Empty parts of the file/buffer will have NULL (0x00) bytes written to them.
841
842
843
844The C<$whence> parameter takes one the usual values, namely SEEK_SET,
845SEEK_CUR or SEEK_END.
846
847Returns 1 on success, 0 on failure.
848
849=head2 binmode
850
851Usage is
852
853 $z->binmode
854 binmode $z ;
855
856This is a noop provided for completeness.
857
858=head2 fileno
859
860 $z->fileno()
861 fileno($z)
862
863If the C<$z> object is associated with a file, this method will return
864the underlying filehandle.
865
866If the C<$z> object is is associated with a buffer, this method will
867return undef.
868
869=head2 close
870
871 $z->close() ;
872 close $z ;
873
874
875
876Flushes any pending compressed data and then closes the output file/buffer.
877
878
879
880For most versions of Perl this method will be automatically invoked if
881the IO::Compress::RawDeflate object is destroyed (either explicitly or by the
882variable with the reference to the object going out of scope). The
883exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In
884these cases, the C<close> method will be called automatically, but
885not until global destruction of all live objects when the program is
886terminating.
887
888Therefore, if you want your scripts to be able to run on all versions
889of Perl, you should call C<close> explicitly and not rely on automatic
890closing.
891
892Returns true on success, otherwise 0.
893
894If the C<AutoClose> option has been enabled when the IO::Compress::RawDeflate
895object was created, and the object is associated with a file, the
896underlying file will also be closed.
897
898
899
900
1a6a8453 901=head2 newStream([OPTS])
642e522c 902
903Usage is
904
1a6a8453 905 $z->newStream( [OPTS] )
642e522c 906
1a6a8453 907Closes the current compressed data stream and starts a new one.
908
909OPTS consists of the following sub-set of the the options that are
910available when creating the C<$z> object,
911
912=over 5
913
914=item * Level
915
916=item * TODO
917
918=back
642e522c 919
920=head2 deflateParams
921
922Usage is
923
924 $z->deflateParams
925
926TODO
927
928=head1 Importing
929
930A number of symbolic constants are required by some methods in
931C<IO::Compress::RawDeflate>. None are imported by default.
932
933=over 5
934
935=item :all
936
937Imports C<rawdeflate>, C<$RawDeflateError> and all symbolic
938constants that can be used by C<IO::Compress::RawDeflate>. Same as doing this
939
940 use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError :constants) ;
941
942=item :constants
943
944Import all symbolic constants. Same as doing this
945
946 use IO::Compress::RawDeflate qw(:flush :level :strategy) ;
947
948=item :flush
949
950These symbolic constants are used by the C<flush> method.
951
952 Z_NO_FLUSH
953 Z_PARTIAL_FLUSH
954 Z_SYNC_FLUSH
955 Z_FULL_FLUSH
956 Z_FINISH
957 Z_BLOCK
958
959
960=item :level
961
962These symbolic constants are used by the C<Level> option in the constructor.
963
964 Z_NO_COMPRESSION
965 Z_BEST_SPEED
966 Z_BEST_COMPRESSION
967 Z_DEFAULT_COMPRESSION
968
969
970=item :strategy
971
972These symbolic constants are used by the C<Strategy> option in the constructor.
973
974 Z_FILTERED
975 Z_HUFFMAN_ONLY
976 Z_RLE
977 Z_FIXED
978 Z_DEFAULT_STRATEGY
979
980=back
981
982For
983
984=head1 EXAMPLES
985
986TODO
987
988
989
990
991
992
993=head1 SEE ALSO
994
995L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Uncompress::RawInflate>, L<IO::Uncompress::AnyInflate>
996
997L<Compress::Zlib::FAQ|Compress::Zlib::FAQ>
998
999L<File::GlobMapper|File::GlobMapper>, L<Archive::Tar|Archive::Zip>,
1000L<IO::Zlib|IO::Zlib>
1001
1002For RFC 1950, 1951 and 1952 see
1003F<http://www.faqs.org/rfcs/rfc1950.html>,
1004F<http://www.faqs.org/rfcs/rfc1951.html> and
1005F<http://www.faqs.org/rfcs/rfc1952.html>
1006
1007The primary site for the gzip program is F<http://www.gzip.org>.
1008
1009=head1 AUTHOR
1010
1011The I<IO::Compress::RawDeflate> module was written by Paul Marquess,
1012F<pmqs@cpan.org>. The latest copy of the module can be
1013found on CPAN in F<modules/by-module/Compress/Compress-Zlib-x.x.tar.gz>.
1014
1015The I<zlib> compression library was written by Jean-loup Gailly
1016F<gzip@prep.ai.mit.edu> and Mark Adler F<madler@alumni.caltech.edu>.
1017
1018The primary site for the I<zlib> compression library is
1019F<http://www.zlib.org>.
1020
1021=head1 MODIFICATION HISTORY
1022
1023See the Changes file.
1024
1025=head1 COPYRIGHT AND LICENSE
1026
1027
1a6a8453 1028Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
642e522c 1029This program is free software; you can redistribute it and/or
1030modify it under the same terms as Perl itself.
1031
1032
1033
1034