summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-16 07:44:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-16 07:44:16 +0000
commit8d18d5b3f9d96be4120b89ff743856021de84e5b (patch)
tree11462788f23b7764043dec021eee3a0ae8ad46c4 /ext/dbm
parent1199a7d3d6399d44662b9a8bea5f359d1fdd40c2 (diff)
2000-06-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/dbm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index c956684..3bf674b 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -98,8 +98,7 @@ fdbm_close(obj)
{
struct dbmdata *dbmp;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
- if (dbmp->di_dbm == 0) closed_dbm();
+ GetDBM(obj, dbmp);
dbm_close(dbmp->di_dbm);
dbmp->di_dbm = 0;
@@ -321,7 +320,7 @@ fdbm_store(obj, keystr, valstr)
val.dptr = RSTRING(valstr)->ptr;
val.dsize = RSTRING(valstr)->len;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
+ GetDBM(obj, dbmp);
dbmp->di_size = -1;
dbm = dbmp->di_dbm;
if (dbm_store(dbm, key, val, DBM_REPLACE)) {
@@ -344,7 +343,7 @@ fdbm_length(obj)
DBM *dbm;
int i = 0;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
+ GetDBM(obj, dbmp);
if (dbmp->di_size > 0) return INT2FIX(dbmp->di_size);
dbm = dbmp->di_dbm;
@@ -365,7 +364,7 @@ fdbm_empty_p(obj)
DBM *dbm;
int i = 0;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
+ GetDBM(obj, dbmp);
if (dbmp->di_size < 0) {
dbm = dbmp->di_dbm;