summaryrefslogtreecommitdiff
path: root/internal.h
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 /internal.h
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 'internal.h')
-rw-r--r--internal.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 3f0fd30122..6409da3d1a 100644
--- a/internal.h
+++ b/internal.h
@@ -442,6 +442,24 @@ struct RComplex {
#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
#endif
+struct RHash {
+ struct RBasic basic;
+ struct st_table *ntbl; /* possibly 0 */
+ int iter_lev;
+ const VALUE ifnone;
+};
+
+#define RHASH(obj) (R_CAST(RHash)(obj))
+
+#ifdef RHASH_ITER_LEV
+#undef RHASH_ITER_LEV
+#undef RHASH_IFNONE
+#undef RHASH_SIZE
+#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)
+#endif
+
/* class.c */
void rb_class_subclass_add(VALUE super, VALUE klass);
void rb_class_remove_from_super_subclasses(VALUE);