diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-27 01:36:19 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-27 01:36:19 +0000 |
commit | ca96e8da24c6fc9b9e29d4e52c0cb88ec69cb8c5 (patch) | |
tree | 894269d7b5505b63245edefb5c665129c823b16f /ext | |
parent | e755ecacf904d9376323df32eb837cee9fbfb07f (diff) | |
download | ruby-ca96e8da24c6fc9b9e29d4e52c0cb88ec69cb8c5.tar.gz |
* ext/zlib/zlib.c (Init_zlib): Add Zlib.defale and Zlib.inflate.
[ruby-dev:42833]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/zlib/zlib.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 2d63570cac..c59d0cbb27 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1227,12 +1227,13 @@ deflate_run(VALUE args) } /* - * call-seq: Zlib::Deflate.deflate(string[, level]) + * call-seq: Zlib.deflate(string[, level]) + * Zlib::Deflate.deflate(string[, level]) * * Compresses the given +string+. Valid values of level are * <tt>Zlib::NO_COMPRESSION</tt>, <tt>Zlib::BEST_SPEED</tt>, * <tt>Zlib::BEST_COMPRESSION</tt>, <tt>Zlib::DEFAULT_COMPRESSION</tt>, and an - * integer from 0 to 9. + * integer from 0 to 9 (the default is 6). * * This method is almost equivalent to the following code: * @@ -1243,7 +1244,7 @@ deflate_run(VALUE args) * dst * end * - * TODO: what's default value of +level+? + * See also Zlib.inflate * */ static VALUE @@ -1478,7 +1479,8 @@ inflate_run(VALUE args) } /* - * call-seq: Zlib::Inflate.inflate(string) + * call-seq: Zlib.inflate(string) + * Zlib::Inflate.inflate(string) * * Decompresses +string+. Raises a Zlib::NeedDict exception if a preset * dictionary is needed for decompression. @@ -1493,6 +1495,8 @@ inflate_run(VALUE args) * buf * end * + * See also Zlib.deflate + * */ static VALUE rb_inflate_s_inflate(VALUE obj, VALUE src) @@ -3705,6 +3709,7 @@ Init_zlib() cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream); rb_define_singleton_method(cDeflate, "deflate", rb_deflate_s_deflate, -1); + rb_define_singleton_method(mZlib, "deflate", rb_deflate_s_deflate, -1); rb_define_alloc_func(cDeflate, rb_deflate_s_allocate); rb_define_method(cDeflate, "initialize", rb_deflate_initialize, -1); rb_define_method(cDeflate, "initialize_copy", rb_deflate_init_copy, 1); @@ -3716,6 +3721,7 @@ Init_zlib() cInflate = rb_define_class_under(mZlib, "Inflate", cZStream); rb_define_singleton_method(cInflate, "inflate", rb_inflate_s_inflate, 1); + rb_define_singleton_method(mZlib, "inflate", rb_inflate_s_inflate, 1); rb_define_alloc_func(cInflate, rb_inflate_s_allocate); rb_define_method(cInflate, "initialize", rb_inflate_initialize, -1); rb_define_method(cInflate, "inflate", rb_inflate_inflate, 1); |