summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-20 08:05:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-20 08:05:44 +0000
commit6259c87d02fce0a77ac90b6786ed1f2bc5baea32 (patch)
tree941121f72d4e32b756acdc1c2a1c4f7a0cb849a3 /ext/dbm
parent52b3e3b97f42498c1f30984cb1e174422c235c80 (diff)
* include/ruby/ruby.h (ExportStringValue): new macro to convert
string in internal encoding to external to export. * string.c (rb_str_export): new function to do conversion to external encoding. * ext/sdbm/init.c: encoding conversion support. * ext/dbm/dbm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/dbm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 42bd4ff..47975cf 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -109,7 +109,7 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!NIL_P(vflags))
flags = NUM2INT(vflags);
- SafeStringValue(file);
+ FilePathValue(file);
if (flags & RUBY_DBM_RW_BIT) {
flags &= ~RUBY_DBM_RW_BIT;
@@ -164,7 +164,7 @@ fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
struct dbmdata *dbmp;
DBM *dbm;
- StringValue(keystr);
+ ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LEN(keystr);
@@ -204,7 +204,7 @@ fdbm_index(VALUE obj, VALUE valstr)
struct dbmdata *dbmp;
DBM *dbm;
- StringValue(valstr);
+ ExportStringValue(valstr);
val.dptr = RSTRING_PTR(valstr);
val.dsize = RSTRING_LEN(valstr);
@@ -272,7 +272,7 @@ fdbm_delete(VALUE obj, VALUE keystr)
VALUE valstr;
fdbm_modify(obj);
- StringValue(keystr);
+ ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LEN(keystr);
@@ -346,7 +346,7 @@ fdbm_delete_if(VALUE obj)
for (i = 0; i < RARRAY_LEN(ary); i++) {
keystr = RARRAY_PTR(ary)[i];
- StringValue(keystr);
+ ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LEN(keystr);
if (dbm_delete(dbm, key)) {
@@ -599,7 +599,7 @@ fdbm_has_key(VALUE obj, VALUE keystr)
struct dbmdata *dbmp;
DBM *dbm;
- StringValue(keystr);
+ ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LEN(keystr);
@@ -616,7 +616,7 @@ fdbm_has_value(VALUE obj, VALUE valstr)
struct dbmdata *dbmp;
DBM *dbm;
- StringValue(valstr);
+ ExportStringValue(valstr);
val.dptr = RSTRING_PTR(valstr);
val.dsize = RSTRING_LEN(valstr);