zlib Functions

In the following functions windowBits is tri-state and multi-valued. For the deflate and inflate functions you can use the full variance:

  • if windowBits is between 9 and 15, inclusive, a zlib header and trailer will be added/expected

    • further, if windowBits has 16 added to it, then add/expect a gzip header and trailer

  • if windowBits is between -15 and -9, inclusive, a raw deflate stream will be created/expected for programs that want to use the raw stream (eg. zip)

  • for inflate, if windowBits is 0 (zero), then the window size in the header will be used

The gzip-* and zlib-* functions enforce gzip and zlib header and trailer respectively meaning:

  • for gzip-compress and gzip-decompress, windowBits defaults to 15 and is range limited from 9 to 15 inclusive and the 16 for a gzip header is added implicitly

    For gzip-decompress a windowBits of 0 (use the window size in the header) is still possible.

  • for zlib-compress and zlib-decompress, windowBits defaults to 15 and is range limited from 9 to 15 inclusive

    For zlib-decompress a windowBits of 0 (use the window size in the header) is still possible.

function zlib/gzip-compress handle (:level Z_DEFAULT_COMPRESSION) (:windowBits 15) (:strategy Z_DEFAULT_STRATEGY)

Return gzip compression of the UTF-8 encoded data stream in handle.

Param handle:

handle

Type handle:

input handle

Keyword :level:

compression level, defaults to Z_DEFAULT_COMPRESSION

Type level:

C/int|fixnum, optional

Keyword :windowBits:

base two logarithm of the window size, defaults to 15

Type windowBits:

C/int|fixnum, optional

Keyword :strategy:

strategy, defaults to Z_DEFAULT_STRATEGY

Type strategy:

C/int|fixnum, optional

Return:

compressed data

Rtype:

octet string

Raises ^rt-zlib-error:

function zlib/gzip-decompress handle (:windowBits 15)

Return gzip decompression of the bytes in handle.

Param handle:

handle

Type handle:

input handle

Keyword :windowBits:

base two logarithm of the window size, defaults to 15

Type windowBits:

C/int|fixnum, optional

Return:

compressed data

Rtype:

octet string

Raises ^rt-zlib-error:

function zlib/zlib-compress handle (:level Z_DEFAULT_COMPRESSION) (:windowBits 15) (:strategy Z_DEFAULT_STRATEGY)

Return zlib compression of the UTF-8 encoded data stream in handle.

Param handle:

handle

Type handle:

input handle

Keyword :level:

compression level, defaults to Z_DEFAULT_COMPRESSION

Type level:

C/int|fixnum, optional

Keyword :windowBits:

base two logarithm of the window size, defaults to 15

Type windowBits:

C/int|fixnum, optional

Keyword :strategy:

strategy, defaults to Z_DEFAULT_STRATEGY

Type strategy:

C/int|fixnum, optional

Return:

compressed data

Rtype:

octet string

Raises ^rt-zlib-error:

function zlib/zlib-decompress handle (:windowBits 15)

Return zlib decompression of the bytes in handle.

Param handle:

handle

Type handle:

input handle

Keyword :windowBits:

base two logarithm of the window size, defaults to 15

Type windowBits:

C/int|fixnum, optional

Return:

compressed data

Rtype:

octet string

Raises ^rt-zlib-error:

function zlib/deflate handle (:level Z_DEFAULT_COMPRESSION) (:windowBits 15) (:strategy Z_DEFAULT_STRATEGY)

Return zlib compression of the UTF-8 encoded data stream in handle.

Param handle:

handle

Type handle:

input handle

Keyword :level:

compression level, defaults to Z_DEFAULT_COMPRESSION

Type level:

C/int|fixnum, optional

Keyword :windowBits:

base two logarithm of the window size, defaults to 15

Type windowBits:

C/int|fixnum, optional

Keyword :strategy:

strategy, defaults to Z_DEFAULT_STRATEGY

Type strategy:

C/int|fixnum, optional

Return:

compressed data

Rtype:

octet string

Raises ^rt-zlib-error:

function zlib/inflate handle (:windowBits 15)

Return zlib decompression of the bytes in handle.

Param handle:

handle

Type handle:

input handle

Keyword :windowBits:

base two logarithm of the window size, defaults to 15

Type windowBits:

C/int|fixnum, optional

Return:

compressed data

Rtype:

octet string

Raises ^rt-zlib-error:

function zlib/zlib-version

Return the zlib version

Return:

zlib version

Rtype:

string

Last built at 2024-12-21T07:10:47Z+0000 from 62cca4c (dev) for Idio 0.3.b.6