summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 07:26:03 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 07:26:03 +0000
commit8250aa2df0d6b4dcfa11dbad5307d28c2d5dd85f (patch)
tree4cfead41f69560cef01dc4c97d87210be083b2d0 /hash.c
parent62bfc4f24e6cddda37461347e884c094080259ea (diff)
* include/ruby/ruby.h (struct RHash): no longer. [Feature #9889]
* include/ruby/ruby.h (RHASH): ditto. * include/ruby/ruby.h (RHASH_ITER_LEV): deprecated. Will be deleted later. * include/ruby/ruby.h (RHASH_IFNONE): ditto. * internal.h (struct RHash): moved here. * internal.h (RHASH): ditto. * hash.c (rb_hash_iter_lev): do not use this. * hash.c (rb_hash_ifnone): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 93efde7..c509dee 100644
--- a/hash.c
+++ b/hash.c
@@ -70,6 +70,12 @@ static VALUE envtbl;
static ID id_hash, id_yield, id_default, id_flatten_bang;
VALUE
+rb_hash_ifnone(VALUE h)
+{
+ return RHASH_IFNONE(h);
+}
+
+VALUE
rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
{
RB_OBJ_WRITE(hash, (&RHASH(hash)->ifnone), ifnone);
@@ -156,6 +162,12 @@ rb_objid_hash(st_index_t index)
return hnum;
}
+int
+rb_hash_iter_lev(VALUE h)
+{
+ return RHASH_ITER_LEV(h);
+}
+
static const struct st_hash_type objhash = {
rb_any_cmp,
rb_any_hash,
@@ -1068,8 +1080,6 @@ delete_if_i(VALUE key, VALUE value, VALUE hash)
return ST_CONTINUE;
}
-static VALUE rb_hash_size(VALUE hash);
-
static VALUE
hash_enum_size(VALUE hash, VALUE args, VALUE eobj)
{
@@ -1478,7 +1488,7 @@ rb_hash_replace(VALUE hash, VALUE hash2)
* h.length #=> 3
*/
-static VALUE
+VALUE
rb_hash_size(VALUE hash)
{
return INT2FIX(RHASH_SIZE(hash));