summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 07:59:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 07:59:14 +0000
commit7566c49068869c222385ffb26bf91b666b3390b1 (patch)
treeabb203e4d6cf86b42d8e7b9d260abf2daef57e00 /enum.c
parentf0e73fc9862c8d2c57a89349fb79012b826b8245 (diff)
ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLIST
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/enum.c b/enum.c
index b742d92..7ff401a 100644
--- a/enum.c
+++ b/enum.c
@@ -44,7 +44,7 @@ rb_enum_values_pack(int argc, VALUE *argv)
#define enum_yield rb_yield_values2
static VALUE
-grep_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+grep_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
@@ -56,7 +56,7 @@ grep_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+grep_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
@@ -97,7 +97,7 @@ enum_grep(VALUE obj, VALUE pat)
}
static VALUE
-count_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
+count_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
NODE *memo = RNODE(memop);
@@ -110,7 +110,7 @@ count_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-count_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
+count_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
NODE *memo = RNODE(memop);
@@ -121,7 +121,7 @@ count_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
+count_all_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
NODE *memo = RNODE(memop);
@@ -176,7 +176,7 @@ enum_count(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-find_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
+find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
ENUM_WANT_SVALUE();
@@ -228,7 +228,7 @@ enum_find(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-find_index_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
+find_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
NODE *memo = RNODE(memop);
@@ -243,7 +243,7 @@ find_index_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv, VALUE blockarg)
+find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
NODE *memo = RNODE(memop);
@@ -299,7 +299,7 @@ enum_find_index(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+find_all_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
ENUM_WANT_SVALUE();
@@ -351,7 +351,7 @@ enum_find_all(VALUE obj)
}
static VALUE
-reject_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+reject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
ENUM_WANT_SVALUE();
@@ -392,7 +392,7 @@ enum_reject(VALUE obj)
}
static VALUE
-collect_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+collect_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
rb_ary_push(ary, enum_yield(argc, argv));
@@ -400,7 +400,7 @@ collect_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-collect_all(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+collect_all(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
rb_thread_check_ints();
rb_ary_push(ary, rb_enum_values_pack(argc, argv));
@@ -439,7 +439,7 @@ enum_collect(VALUE obj)
}
static VALUE
-flat_map_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+flat_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
VALUE tmp;
@@ -510,7 +510,7 @@ enum_to_a(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-enum_to_h_i(VALUE i, VALUE hash, int argc, VALUE *argv, VALUE blockarg)
+enum_to_h_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
{
ENUM_WANT_SVALUE();
rb_thread_check_ints();
@@ -543,7 +543,7 @@ enum_to_h(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-inject_i(VALUE i, VALUE p, int argc, VALUE *argv, VALUE blockarg)
+inject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
NODE *memo = RNODE(p);
@@ -560,7 +560,7 @@ inject_i(VALUE i, VALUE p, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv, VALUE blockarg)
+inject_op_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
NODE *memo = RNODE(p);
VALUE name;
@@ -662,7 +662,7 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-partition_i(VALUE i, VALUE arys, int argc, VALUE *argv, VALUE blockarg)
+partition_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arys))
{
NODE *memo = RNODE(arys);
VALUE ary;
@@ -707,7 +707,7 @@ enum_partition(VALUE obj)
}
static VALUE
-group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv, VALUE blockarg)
+group_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
{
VALUE group;
VALUE values;
@@ -756,7 +756,7 @@ enum_group_by(VALUE obj)
}
static VALUE
-first_i(VALUE i, VALUE params, int argc, VALUE *argv, VALUE blockarg)
+first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, params))
{
NODE *memo = RNODE(params);
ENUM_WANT_SVALUE();
@@ -832,7 +832,7 @@ struct sort_by_data {
};
static VALUE
-sort_by_i(VALUE i, VALUE _data, int argc, VALUE *argv, VALUE blockarg)
+sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
{
struct sort_by_data *data = (struct sort_by_data *)&RNODE(_data)->u1;
VALUE ary = data->ary;
@@ -1003,13 +1003,13 @@ enum_sort_by(VALUE obj)
static VALUE enum_##name##_func(VALUE result, NODE *memo); \
\
static VALUE \
-name##_i(VALUE i, VALUE memo, int argc, VALUE *argv, VALUE blockarg) \
+name##_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
return enum_##name##_func(rb_enum_values_pack(argc, argv), RNODE(memo)); \
} \
\
static VALUE \
-name##_iter_i(VALUE i, VALUE memo, int argc, VALUE *argv, VALUE blockarg) \
+name##_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
return enum_##name##_func(enum_yield(argc, argv), RNODE(memo)); \
} \
@@ -1162,7 +1162,7 @@ enum_none(VALUE obj)
}
static VALUE
-min_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+min_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
VALUE cmp;
NODE *memo = RNODE(args);
@@ -1182,7 +1182,7 @@ min_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-min_ii(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
VALUE cmp;
NODE *memo = RNODE(args);
@@ -1234,7 +1234,7 @@ enum_min(VALUE obj)
}
static VALUE
-max_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+max_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
VALUE cmp;
@@ -1254,7 +1254,7 @@ max_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-max_ii(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
VALUE cmp;
@@ -1334,7 +1334,7 @@ minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
}
static VALUE
-minmax_i(VALUE i, VALUE _memo, int argc, VALUE *argv, VALUE blockarg)
+minmax_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
{
struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
int n;
@@ -1386,7 +1386,7 @@ minmax_ii_update(VALUE i, VALUE j, struct minmax_t *memo)
}
static VALUE
-minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv, VALUE blockarg)
+minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
{
struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
int n;
@@ -1458,7 +1458,7 @@ enum_minmax(VALUE obj)
}
static VALUE
-min_by_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+min_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
VALUE v;
@@ -1504,7 +1504,7 @@ enum_min_by(VALUE obj)
}
static VALUE
-max_by_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+max_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
VALUE v;
@@ -1580,7 +1580,7 @@ minmax_by_i_update(VALUE v1, VALUE v2, VALUE i1, VALUE i2, struct minmax_by_t *m
}
static VALUE
-minmax_by_i(VALUE i, VALUE _memo, int argc, VALUE *argv, VALUE blockarg)
+minmax_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
{
struct minmax_by_t *memo = MEMO_FOR(struct minmax_by_t, _memo);
VALUE vi, vj, j;
@@ -1656,7 +1656,7 @@ enum_minmax_by(VALUE obj)
}
static VALUE
-member_i(VALUE iter, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
{
NODE *memo = RNODE(args);
@@ -1690,7 +1690,7 @@ enum_member(VALUE obj, VALUE val)
}
static VALUE
-each_with_index_i(VALUE i, VALUE memo, int argc, VALUE *argv, VALUE blockarg)
+each_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
{
long n = RNODE(memo)->u3.cnt++;
@@ -1766,7 +1766,7 @@ enum_reverse_each(int argc, VALUE *argv, VALUE obj)
static VALUE
-each_val_i(VALUE i, VALUE p, int argc, VALUE *argv, VALUE blockarg)
+each_val_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
ENUM_WANT_SVALUE();
rb_yield(i);
@@ -1811,7 +1811,7 @@ enum_each_entry(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-each_slice_i(VALUE i, VALUE m, int argc, VALUE *argv, VALUE blockarg)
+each_slice_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
{
NODE *memo = RNODE(m);
VALUE ary = memo->u1.value;
@@ -1878,7 +1878,7 @@ enum_each_slice(VALUE obj, VALUE n)
}
static VALUE
-each_cons_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+each_cons_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
VALUE ary = memo->u1.value;
@@ -1946,7 +1946,7 @@ enum_each_cons(VALUE obj, VALUE n)
}
static VALUE
-each_with_object_i(VALUE i, VALUE memo, int argc, VALUE *argv, VALUE blockarg)
+each_with_object_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
{
ENUM_WANT_SVALUE();
return rb_yield_values(2, i, memo);
@@ -1977,7 +1977,7 @@ enum_each_with_object(VALUE obj, VALUE memo)
}
static VALUE
-zip_ary(VALUE val, VALUE memoval, int argc, VALUE *argv, VALUE blockarg)
+zip_ary(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
{
NODE *memo = (NODE *)memoval;
volatile VALUE result = memo->u1.value;
@@ -2020,7 +2020,7 @@ call_stop(VALUE *v)
}
static VALUE
-zip_i(VALUE val, VALUE memoval, int argc, VALUE *argv, VALUE blockarg)
+zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
{
NODE *memo = (NODE *)memoval;
volatile VALUE result = memo->u1.value;
@@ -2118,7 +2118,7 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-take_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+take_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
@@ -2157,7 +2157,7 @@ enum_take(VALUE obj, VALUE n)
static VALUE
-take_while_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+take_while_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
if (!RTEST(enum_yield(argc, argv))) rb_iter_break();
rb_ary_push(ary, rb_enum_values_pack(argc, argv));
@@ -2191,7 +2191,7 @@ enum_take_while(VALUE obj)
}
static VALUE
-drop_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+drop_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
if (memo->u3.cnt == 0) {
@@ -2234,7 +2234,7 @@ enum_drop(VALUE obj, VALUE n)
static VALUE
-drop_while_i(VALUE i, VALUE args, int argc, VALUE *argv, VALUE blockarg)
+drop_while_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
@@ -2278,7 +2278,7 @@ enum_drop_while(VALUE obj)
}
static VALUE
-cycle_i(VALUE i, VALUE ary, int argc, VALUE *argv, VALUE blockarg)
+cycle_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
ENUM_WANT_SVALUE();
@@ -2365,7 +2365,7 @@ struct chunk_arg {
};
static VALUE
-chunk_ii(VALUE i, VALUE _argp, int argc, VALUE *argv, VALUE blockarg)
+chunk_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
{
struct chunk_arg *argp = MEMO_FOR(struct chunk_arg, _argp);
VALUE v;
@@ -2415,7 +2415,7 @@ chunk_ii(VALUE i, VALUE _argp, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv, VALUE blockarg)
+chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
{
VALUE enumerable;
VALUE arg;
@@ -2560,7 +2560,7 @@ struct slicebefore_arg {
};
static VALUE
-slicebefore_ii(VALUE i, VALUE _argp, int argc, VALUE *argv, VALUE blockarg)
+slicebefore_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
{
struct slicebefore_arg *argp = MEMO_FOR(struct slicebefore_arg, _argp);
VALUE header_p;
@@ -2589,7 +2589,7 @@ slicebefore_ii(VALUE i, VALUE _argp, int argc, VALUE *argv, VALUE blockarg)
}
static VALUE
-slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv, VALUE blockarg)
+slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
{
VALUE enumerable;
VALUE arg;