new(...)
public
Creates a new inflate stream for decompression. See
zlib.h for details of the argument. If window_bits is
nil, the default value is used.
TODO: document better!
Show source
/*
* call-seq: Zlib::Inflate.new(window_bits)
*
* Creates a new inflate stream for decompression. See zlib.h for details
* of the argument. If +window_bits+ is +nil+, the default value is used.
*
* TODO: document better!
*/
static VALUE
rb_inflate_initialize(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
{
struct zstream *z;
VALUE wbits;
int err;
rb_scan_args(argc, argv, "01", &wbits);
Data_Get_Struct(obj, struct zstream, z);
err = inflateInit2(&z->stream, ARG_WBITS(wbits));
if (err != Z_OK) {
raise_zlib_error(err, z->stream.msg);
}
ZSTREAM_READY(z);
return obj;
}