summaryrefslogtreecommitdiff
path: root/ext/-test-/funcall/funcall.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/funcall/funcall.c')
-rw-r--r--ext/-test-/funcall/funcall.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/ext/-test-/funcall/funcall.c b/ext/-test-/funcall/funcall.c
index 4e13c95..43521bf 100644
--- a/ext/-test-/funcall/funcall.c
+++ b/ext/-test-/funcall/funcall.c
@@ -1,7 +1,5 @@
#include "ruby.h"
-VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
-
static VALUE
with_funcall2(int argc, VALUE *argv, VALUE self)
{
@@ -15,6 +13,24 @@ with_funcall_passing_block(int argc, VALUE *argv, VALUE self)
}
static VALUE
+with_funcall_passing_block_kw(int argc, VALUE *argv, VALUE self)
+{
+ return rb_funcall_passing_block_kw(self, rb_intern("target"), argc-1, argv+1, FIX2INT(argv[0]));
+}
+
+static VALUE
+with_funcallv_public_kw(int argc, VALUE *argv, VALUE self)
+{
+ return rb_funcallv_public_kw(argv[0], SYM2ID(argv[1]), argc-3, argv+3, FIX2INT(argv[2]));
+}
+
+static VALUE
+with_yield_splat_kw(int argc, VALUE *argv, VALUE self)
+{
+ return rb_yield_splat_kw(argv[1], FIX2INT(argv[0]));
+}
+
+static VALUE
extra_args_name(VALUE self)
{
/*
@@ -35,9 +51,21 @@ Init_funcall(void)
with_funcall2,
-1);
rb_define_singleton_method(cRelay,
+ "with_funcall_passing_block_kw",
+ with_funcall_passing_block_kw,
+ -1);
+ rb_define_singleton_method(cRelay,
"with_funcall_passing_block",
with_funcall_passing_block,
-1);
+ rb_define_singleton_method(cRelay,
+ "with_funcallv_public_kw",
+ with_funcallv_public_kw,
+ -1);
+ rb_define_singleton_method(cRelay,
+ "with_yield_splat_kw",
+ with_yield_splat_kw,
+ -1);
rb_define_singleton_method(cTestFuncall, "extra_args_name",
extra_args_name,
0);