summaryrefslogtreecommitdiff
path: root/ext/gdbm
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-21 08:48:33 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-21 08:48:33 +0000
commitffc456d0ed1acf478ff991c88e35b2038dccb402 (patch)
tree847b4cfc16cc66aac40816b9e9769ffb64f95794 /ext/gdbm
parenteeceb720a9589bd9a0acf47db9da05668d7a5865 (diff)
* ext/dbm/dbm.c (fdbm_each_value, fdbm_each_key, fdbm_each_pair):
GDBM#{each,each_pair,each_key,each_value}: Return an enumerator if no block is given. * ext/gdbm/gdbm.c (fgdbm_each_value, fgdbm_each_key, fgdbm_each_pair): GDBM#{each,each_pair,each_key,each_value}: Return an enumerator if no block is given. * ext/openssl/ossl_config.c (ossl_config_each): OpenSSL::Config#each: Return an enumerator if no block is given. * ext/readline/readline.c (hist_each): Readline::HISTORY#each: Return an enumerator if no block is given. * ext/sdbm/init.c (fsdbm_each_value, fsdbm_each_key, fsdbm_each_pair): SDBM#{each,each_pair,each_key,each_value}: Return an enumerator if no block is given. * ext/stringio/stringio.c (strio_each_byte, strio_each): StringIO#{each,each_line,each_byte}: Return an enumerator if no block is given. * ext/stringio/stringio.c (Init_stringio): Add #lines and #bytes, which are aliases to #each_line and #each_byte, respectively. * ext/win32ole/win32ole.c (fole_each): WIN32OLE#each: Return an enumerator if no block is given. * ext/zlib/zlib.c (rb_gzreader_each_byte, rb_gzreader_each): Zlib::GzipReader#{each,each_line,each_byte}: Return an enumerator if no block is given. * ext/zlib/zlib.c (Init_zlib): Add Zlib::GzipReader#lines and #bytes, which are aliases to #each_line and #each_byte, respectively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gdbm')
-rw-r--r--ext/gdbm/gdbm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 8a1acbc96f..04fdf886b5 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -801,6 +801,8 @@ fgdbm_each_value(VALUE obj)
GDBM_FILE dbm;
VALUE keystr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -825,6 +827,8 @@ fgdbm_each_key(VALUE obj)
GDBM_FILE dbm;
VALUE keystr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -849,6 +853,8 @@ fgdbm_each_pair(VALUE obj)
struct dbmdata *dbmp;
VALUE keystr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {