summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-01 07:23:56 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-01 07:23:56 +0000
commit26f59b09fe3a1c2ec50145f7c3d5b425f48a7a32 (patch)
treed0237be78237736d42b3dc47d3797f80ce5d3351 /struct.c
parent0a86f7ff71f3da557d5e2e11c7bd637726b5d123 (diff)
downloadruby-26f59b09fe3a1c2ec50145f7c3d5b425f48a7a32.tar.gz
hide struct internal [Feature #9916]
* include/ruby/ruby.h (struct RStruct): no longer. * internal.h (struct RStruct): moved here. * struct.c (rb_struct_ptr): a compensation function for the lack of RSTRUCT_PTR. But now that we have RSTRUCT_GET/SET, that must not be used anyway. I mark this deprecated. Dont use it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/struct.c b/struct.c
index a4cab45945..150ca20a39 100644
--- a/struct.c
+++ b/struct.c
@@ -617,9 +617,6 @@ rb_struct_new(VALUE klass, ...)
}
static VALUE
-rb_struct_size(VALUE s);
-
-static VALUE
struct_enum_size(VALUE s, VALUE args, VALUE eobj)
{
return rb_struct_size(s);
@@ -1123,12 +1120,18 @@ rb_struct_eql(VALUE s, VALUE s2)
* joe.length #=> 3
*/
-static VALUE
+VALUE
rb_struct_size(VALUE s)
{
return LONG2FIX(RSTRUCT_LEN(s));
}
+const VALUE*
+rb_struct_ptr(VALUE s)
+{
+ return RSTRUCT_CONST_PTR(s);
+}
+
/*
* call-seq:
* struct.dig(key, ...) -> object