From 21606c6ec56bf11be012f391e43974132ae5646f Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 11 Jun 2004 13:33:47 +0000 Subject: * array.c: remove #indexes, #indices. * hash.c: ditto. * ext/dbm/dbm.c: remove #indexes, #indices, "values_at" warning from #select. * ext/gdbm/gdbm.c: ditto. * ext/sdbm/init.c: ditto. * ext/dbm/dbm.c (Init_dbm): set VERSION constant as "unknown" when DB_VERSION_STRING is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/gdbm/gdbm.c | 60 +++++++++++++-------------------------------------------- 1 file changed, 13 insertions(+), 47 deletions(-) (limited to 'ext/gdbm/gdbm.c') diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c index 799445a89c..49c86149e2 100644 --- a/ext/gdbm/gdbm.c +++ b/ext/gdbm/gdbm.c @@ -316,56 +316,24 @@ fgdbm_index(obj, valstr) } static VALUE -fgdbm_indexes(argc, argv, obj) - int argc; - VALUE *argv; - VALUE obj; -{ - VALUE new; - int i; - - new = rb_ary_new2(argc); - for (i=0; i 0) { - rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc); - } - GetDBM(obj, dbmp); - dbm = dbmp->di_dbm; - - for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr); - keystr = rb_gdbm_nextkey(dbm, keystr)) { - VALUE assoc = rb_assoc_new(keystr, rb_gdbm_fetch2(dbm, keystr)); + GetDBM(obj, dbmp); + dbm = dbmp->di_dbm; - if (RTEST(rb_yield(assoc))) - rb_ary_push(new, assoc); - } - } - else { - rb_warn("GDBM#select(index..) is deprecated; use GDBM#values_at"); + for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr); + keystr = rb_gdbm_nextkey(dbm, keystr)) { + VALUE assoc = rb_assoc_new(keystr, rb_gdbm_fetch2(dbm, keystr)); - for (i=0; i