summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/ruby/intern.h3
-rw-r--r--include/ruby/ruby.h13
2 files changed, 6 insertions, 10 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 486b469..f985853 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -508,6 +508,9 @@ struct st_table *rb_hash_tbl(VALUE);
int rb_path_check(const char*);
int rb_env_path_tainted(void);
VALUE rb_env_clear(void);
+VALUE rb_hash_size(VALUE);
+DEPRECATED(int rb_hash_iter_lev(VALUE));
+DEPRECATED(VALUE rb_hash_ifnone(VALUE));
/* io.c */
#define rb_defout rb_stdout
RUBY_EXTERN VALUE rb_fs;
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 9181382..7bb3228 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -919,17 +919,11 @@ struct RRegexp {
#define RREGEXP_SRC_LEN(r) RSTRING_LEN(RREGEXP(r)->src)
#define RREGEXP_SRC_END(r) RSTRING_END(RREGEXP(r)->src)
-struct RHash {
- struct RBasic basic;
- struct st_table *ntbl; /* possibly 0 */
- int iter_lev;
- const VALUE ifnone;
-};
/* RHASH_TBL allocates st_table if not available. */
#define RHASH_TBL(h) rb_hash_tbl(h)
-#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
-#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
-#define RHASH_SIZE(h) (RHASH(h)->ntbl ? (st_index_t)RHASH(h)->ntbl->num_entries : 0)
+#define RHASH_ITER_LEV(h) rb_hash_iter_lev(h)
+#define RHASH_IFNONE(h) rb_hash_ifnone(h)
+#define RHASH_SIZE(h) NUM2SIZET(rb_hash_size(h))
#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone)
@@ -1069,7 +1063,6 @@ struct RStruct {
#define RSTRING(obj) (R_CAST(RString)(obj))
#define RREGEXP(obj) (R_CAST(RRegexp)(obj))
#define RARRAY(obj) (R_CAST(RArray)(obj))
-#define RHASH(obj) (R_CAST(RHash)(obj))
#define RDATA(obj) (R_CAST(RData)(obj))
#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))