Module: FFI::Zlib

Extended by:
Library
Defined in:
lib/ffi/zlib.rb

Overview

Defined Under Namespace

Classes: GZ_header, Z_stream

Constant Summary collapse

ZLIB_VERSION =

zlibVersion()
Z_NO_FLUSH =

Allowed flush values.

0
Z_PARTIAL_FLUSH =
1
Z_SYNC_FLUSH =
2
Z_FULL_FLUSH =
3
Z_FINISH =
4
Z_BLOCK =
5
Z_OK =

Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events.

0
Z_STREAM_END =
1
Z_NEED_DICT =
2
Z_ERRNO =
-1
Z_STREAM_ERROR =
-2
Z_DATA_ERROR =
-3
Z_MEM_ERROR =
-4
Z_BUF_ERROR =
-5
Z_VERSION_ERROR =
-6
Z_NO_COMPRESSION =

Compression levels.

0
Z_BEST_SPEED =
1
Z_BEST_COMPRESSION =
9
Z_DEFAULT_COMPRESSION =
-1
Z_FILTERED =

Compression strategies.

1
Z_HUFFMAN_ONLY =
2
Z_RLE =
3
Z_FIXED =
4
Z_DEFAULT_STRATEGY =
0
Z_BINARY =

Possible values of the data_type field.

0
Z_TEXT =
1
Z_UNKNOWN =
2
Z_DEFLATED =

The deflate compression method (the only one supported).

8

Class Method Summary collapse

Class Method Details

.deflateInit(zstream, level) ⇒ Object




114
115
116
# File 'lib/ffi/zlib.rb', line 114

def self.deflateInit(zstream, level)
    deflateInit_(zstream, level, ZLIB_VERSION, zstream.size)
end

.deflateInit2(zstream, level, method, window_bits, mem_level, strategy) ⇒ Object



118
119
120
# File 'lib/ffi/zlib.rb', line 118

def self.deflateInit2(zstream, level, method, window_bits, mem_level, strategy)
    deflateInit2_(zstream, level, method, window_bits, mem_level, strategy, ZLIB_VERSION, zstream.size)
end

.inflateInit(zstream) ⇒ Object




138
139
140
# File 'lib/ffi/zlib.rb', line 138

def self.inflateInit(zstream)
    inflateInit_(zstream, ZLIB_VERSION, zstream.size)
end

.inflateInit2(zstream, window_bits) ⇒ Object



142
143
144
# File 'lib/ffi/zlib.rb', line 142

def self.inflateInit2(zstream, window_bits)
    inflateInit2_(zstream, window_bits, ZLIB_VERSION, zstream.size)
end