Skip to content
Snippets Groups Projects
Commit 5b615ab3 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

new files (doc for zlibmod)

Rev: src/modules/zlibmod/doc/gz_deflate:1.1
Rev: src/modules/zlibmod/doc/gz_inflate:1.1
parent 22103b96
Branches
Tags
No related merge requests found
NAME
Gz_deflate - gzip packer
DESCRIPTION
Gz_inflate is a builtin program written in C. It interfaces the
packing routines in the libz library.
NOTA BENE
This program is only available if libz was available and found when
Pike was compiled.
SEE ALSO
gz_inflate
============================================================================
NAME
create - initialize gzip packer
SYNTAX
void create(int X)
or
object(Gz_deflate) Gz_deflate(int X)
DESCRIPTION
This functionion is called when a new Gz_deflate is created.
If given, X should be a number from 0 to 9 indicating the packing /
cpu ratio. Zero means no packing, 2-3 is considered 'fast', 6 is
default and higher is considered 'slow' but gives better packing.
This function can also be used to re-initialize a gz_deflate object
so it can be re-used.
============================================================================
NAME
deflate - pack data
SYNAX
string deflate(string data, int flush);
DESCRIPTION
This function preforms gzip style compression on a string and
returns the packed data. Streaming can be done by calling this
functon several time and concatenating the returned data.
The optional 'flush' argument should be one f the following:
Gz_deflate->NO_FLUSH Only data that doesn't fit in the
internal buffers is returned.
Gz_deflate->PARTIAL_FLUSH All input is packed and returned.
Gz_deflate->SYNC_FLUSH All input is packed and returned.
Packing is syncronized.
Gz_deflate->FINISH All input is packed and an 'end of
data' marker is appended.
Using flushing will degrade packing. Normally NO_FLUSH should be
used until the end of the data when FINISH should be used. For
interactive data PARTIAL_FLUSH should be used.
SEE ALSO
gz_inflate->inflate
============================================================================
NAME
Gz_inflate - gzip unpacker
DESCRIPTION
Gz_inflate is a builtin program written in C. It interfaces the
packing routines in the libz library.
NOTA BENE
This program is only available if libz was available and found when
Pike was compiled.
SEE ALSO
gz_deflate
============================================================================
NAME
create - initialize gzip packer
SYNTAX
void create()
or
object(Gz_inflate) Gz_inflate()
DESCRIPTION
This functionion is called when a new Gz_inflate is created.
It can also be called after the object has been used to re-initialize
it.
============================================================================
NAME
inflate - unpack data
SYNAX
string inflate(string data);
DESCRIPTION
This function preforms gzip style decompression. It can inflate
a whole file at once or in blocks.
EXAMPLES
#include <stdio.h>
// whole file
write(Gz_inflate()->inflate(stdin->read(0x7fffffff));
// streaming (blocks)
function inflate=Gz_inflate()->inflate;
while(string s=stdin->read(8192))
write(inflate(s));
SEE ALSO
gz_deflate->deflate
============================================================================
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment