summaryrefslogtreecommitdiff
path: root/ext/sdbm/init.c
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/sdbm/init.c
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/sdbm/init.c')
-rw-r--r--ext/sdbm/init.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 1e1d5a5..ddbf384 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -92,8 +92,7 @@ fsdbm_close(obj)
{
struct dbmdata *dbmp;
- Data_Get_Struct(obj, struct dbmdata, dbmp);
- if (dbmp->di_dbm == 0) closed_sdbm();
+ GetDBM(obj, dbmp);
sdbm_close(dbmp->di_dbm);
dbmp->di_dbm = 0;
@@ -322,7 +321,7 @@ fsdbm_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 (sdbm_store(dbm, key, val, DBM_REPLACE)) {
@@ -345,7 +344,7 @@ fsdbm_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;
@@ -366,7 +365,7 @@ fsdbm_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;