From 8250aa2df0d6b4dcfa11dbad5307d28c2d5dd85f Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 23 Jun 2014 07:26:03 +0000 Subject: * 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 --- hash.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 93efde762a..c509deef30 100644 --- a/hash.c +++ b/hash.c @@ -69,6 +69,12 @@ VALUE rb_cHash; 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) { @@ -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)); -- cgit v1.2.3