Ruby  1.9.3p448(2013-06-27revision41675)
Data Structures | Macros | Functions | Variables
enum.c File Reference
#include "ruby/ruby.h"
#include "ruby/util.h"
#include "node.h"
#include "id.h"
Include dependency graph for enum.c:

Go to the source code of this file.

Data Structures

struct  sort_by_data
 
struct  minmax_t
 
struct  minmax_by_t
 
struct  chunk_arg
 
struct  slicebefore_arg
 

Macros

#define id_each   idEach
 
#define id_eqq   idEqq
 
#define id_cmp   idCmp
 
#define ENUM_WANT_SVALUE()
 
#define enum_yield   rb_yield_values2
 
#define SORT_BY_BUFSIZE   16
 
#define ENUMFUNC(name)   rb_block_given_p() ? name##_iter_i : name##_i
 
#define DEFINE_ENUMFUNCS(name)
 
#define rb_intern(str)   rb_intern_const(str)
 

Functions

static VALUE enum_values_pack (int argc, VALUE *argv)
 
static VALUE grep_i (VALUE i, VALUE args, int argc, VALUE *argv)
 
static VALUE grep_iter_i (VALUE i, VALUE args, int argc, VALUE *argv)
 
static VALUE enum_grep (VALUE obj, VALUE pat)
 
static VALUE count_i (VALUE i, VALUE memop, int argc, VALUE *argv)
 
static VALUE count_iter_i (VALUE i, VALUE memop, int argc, VALUE *argv)
 
static VALUE count_all_i (VALUE i, VALUE memop, int argc, VALUE *argv)
 
static VALUE enum_count (int argc, VALUE *argv, VALUE obj)
 
static VALUE find_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_find (int argc, VALUE *argv, VALUE obj)
 
static VALUE find_index_i (VALUE i, VALUE memop, int argc, VALUE *argv)
 
static VALUE find_index_iter_i (VALUE i, VALUE memop, int argc, VALUE *argv)
 
static VALUE enum_find_index (int argc, VALUE *argv, VALUE obj)
 
static VALUE find_all_i (VALUE i, VALUE ary, int argc, VALUE *argv)
 
static VALUE enum_find_all (VALUE obj)
 
static VALUE reject_i (VALUE i, VALUE ary, int argc, VALUE *argv)
 
static VALUE enum_reject (VALUE obj)
 
static VALUE collect_i (VALUE i, VALUE ary, int argc, VALUE *argv)
 
static VALUE collect_all (VALUE i, VALUE ary, int argc, VALUE *argv)
 
static VALUE enum_collect (VALUE obj)
 
static VALUE flat_map_i (VALUE i, VALUE ary, int argc, VALUE *argv)
 
static VALUE enum_flat_map (VALUE obj)
 
static VALUE enum_to_a (int argc, VALUE *argv, VALUE obj)
 
static VALUE inject_i (VALUE i, VALUE p, int argc, VALUE *argv)
 
static VALUE inject_op_i (VALUE i, VALUE p, int argc, VALUE *argv)
 
static VALUE enum_inject (int argc, VALUE *argv, VALUE obj)
 
static VALUE partition_i (VALUE i, VALUE *ary, int argc, VALUE *argv)
 
static VALUE enum_partition (VALUE obj)
 
static VALUE group_by_i (VALUE i, VALUE hash, int argc, VALUE *argv)
 
static VALUE enum_group_by (VALUE obj)
 
static VALUE first_i (VALUE i, VALUE *params, int argc, VALUE *argv)
 
static VALUE enum_first (int argc, VALUE *argv, VALUE obj)
 
static VALUE enum_sort (VALUE obj)
 
static VALUE sort_by_i (VALUE i, VALUE _data, int argc, VALUE *argv)
 
static int sort_by_cmp (const void *ap, const void *bp, void *data)
 
static VALUE enum_sort_by (VALUE obj)
 
 DEFINE_ENUMFUNCS (all)
 
static VALUE enum_all (VALUE obj)
 
 DEFINE_ENUMFUNCS (any)
 
static VALUE enum_any (VALUE obj)
 
 DEFINE_ENUMFUNCS (one)
 
static VALUE enum_one (VALUE obj)
 
 DEFINE_ENUMFUNCS (none)
 
static VALUE enum_none (VALUE obj)
 
static VALUE min_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE min_ii (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_min (VALUE obj)
 
static VALUE max_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE max_ii (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_max (VALUE obj)
 
static void minmax_i_update (VALUE i, VALUE j, struct minmax_t *memo)
 
static VALUE minmax_i (VALUE i, VALUE _memo, int argc, VALUE *argv)
 
static void minmax_ii_update (VALUE i, VALUE j, struct minmax_t *memo)
 
static VALUE minmax_ii (VALUE i, VALUE _memo, int argc, VALUE *argv)
 
static VALUE enum_minmax (VALUE obj)
 
static VALUE min_by_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_min_by (VALUE obj)
 
static VALUE max_by_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_max_by (VALUE obj)
 
static void minmax_by_i_update (VALUE v1, VALUE v2, VALUE i1, VALUE i2, struct minmax_by_t *memo)
 
static VALUE minmax_by_i (VALUE i, VALUE _memo, int argc, VALUE *argv)
 
static VALUE enum_minmax_by (VALUE obj)
 
static VALUE member_i (VALUE iter, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_member (VALUE obj, VALUE val)
 
static VALUE each_with_index_i (VALUE i, VALUE memo, int argc, VALUE *argv)
 
static VALUE enum_each_with_index (int argc, VALUE *argv, VALUE obj)
 
static VALUE enum_reverse_each (int argc, VALUE *argv, VALUE obj)
 
static VALUE each_val_i (VALUE i, VALUE p, int argc, VALUE *argv)
 
static VALUE enum_each_entry (int argc, VALUE *argv, VALUE obj)
 
static VALUE each_slice_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_each_slice (VALUE obj, VALUE n)
 
static VALUE each_cons_i (VALUE i, VALUE *memo, int argc, VALUE *argv)
 
static VALUE enum_each_cons (VALUE obj, VALUE n)
 
static VALUE each_with_object_i (VALUE i, VALUE memo, int argc, VALUE *argv)
 
static VALUE enum_each_with_object (VALUE obj, VALUE memo)
 
static VALUE zip_ary (VALUE val, NODE *memo, int argc, VALUE *argv)
 
static VALUE call_next (VALUE *v)
 
static VALUE call_stop (VALUE *v)
 
static VALUE zip_i (VALUE val, NODE *memo, int argc, VALUE *argv)
 
static VALUE enum_zip (int argc, VALUE *argv, VALUE obj)
 
static VALUE take_i (VALUE i, VALUE *arg, int argc, VALUE *argv)
 
static VALUE enum_take (VALUE obj, VALUE n)
 
static VALUE take_while_i (VALUE i, VALUE *ary, int argc, VALUE *argv)
 
static VALUE enum_take_while (VALUE obj)
 
static VALUE drop_i (VALUE i, VALUE *arg, int argc, VALUE *argv)
 
static VALUE enum_drop (VALUE obj, VALUE n)
 
static VALUE drop_while_i (VALUE i, VALUE *args, int argc, VALUE *argv)
 
static VALUE enum_drop_while (VALUE obj)
 
static VALUE cycle_i (VALUE i, VALUE ary, int argc, VALUE *argv)
 
static VALUE enum_cycle (int argc, VALUE *argv, VALUE obj)
 
static VALUE chunk_ii (VALUE i, VALUE _argp, int argc, VALUE *argv)
 
static VALUE chunk_i (VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
 
static VALUE enum_chunk (int argc, VALUE *argv, VALUE enumerable)
 
static VALUE slicebefore_ii (VALUE i, VALUE _argp, int argc, VALUE *argv)
 
static VALUE slicebefore_i (VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
 
static VALUE enum_slice_before (int argc, VALUE *argv, VALUE enumerable)
 
void Init_Enumerable (void)
 

Variables

VALUE rb_mEnumerable
 
static ID id_next
 

Macro Definition Documentation

#define DEFINE_ENUMFUNCS (   name)
Value:
static VALUE enum_##name##_func(VALUE result, VALUE *memo); \
\
static VALUE \
name##_i(VALUE i, VALUE *memo, int argc, VALUE *argv) \
{ \
return enum_##name##_func(enum_values_pack(argc, argv), memo); \
} \
\
static VALUE \
name##_iter_i(VALUE i, VALUE *memo, int argc, VALUE *argv) \
{ \
return enum_##name##_func(enum_yield(argc, argv), memo); \
} \
\
static VALUE \
enum_##name##_func(VALUE result, VALUE *memo)
int i
Definition: win32ole.c:776
int argc
Definition: ruby.c:120
unsigned long VALUE
Definition: ruby.h:88
static VALUE result
Definition: nkf.c:40
#define enum_yield
Definition: enum.c:35
return
Definition: name2ctype.h:23857
const char * name
Definition: nkf.c:208
static VALUE enum_values_pack(int argc, VALUE *argv)
Definition: enum.c:24
char ** argv
Definition: ruby.c:121

Definition at line 939 of file enum.c.

#define ENUM_WANT_SVALUE ( )
#define enum_yield   rb_yield_values2

Definition at line 35 of file enum.c.

Referenced by collect_i(), count_iter_i(), find_index_iter_i(), flat_map_i(), and take_while_i().

#define ENUMFUNC (   name)    rb_block_given_p() ? name##_iter_i : name##_i

Definition at line 937 of file enum.c.

Referenced by enum_all(), enum_any(), enum_none(), and enum_one().

#define id_cmp   idCmp
#define id_each   idEach
#define id_eqq   idEqq

Definition at line 20 of file enum.c.

Referenced by grep_i(), grep_iter_i(), and slicebefore_ii().

#define rb_intern (   str)    rb_intern_const(str)
#define SORT_BY_BUFSIZE   16

Definition at line 772 of file enum.c.

Referenced by enum_sort_by(), and sort_by_i().

Function Documentation

static VALUE call_next ( VALUE v)
static

Definition at line 1911 of file enum.c.

References id_next, and rb_funcall().

Referenced by zip_i().

static VALUE call_stop ( VALUE v)
static

Definition at line 1917 of file enum.c.

References Qundef.

Referenced by zip_i().

static VALUE chunk_i ( VALUE  yielder,
VALUE  enumerator,
int  argc,
VALUE argv 
)
static
static VALUE chunk_ii ( VALUE  i,
VALUE  _argp,
int  argc,
VALUE argv 
)
static
static VALUE collect_all ( VALUE  i,
VALUE  ary,
int  argc,
VALUE argv 
)
static

Definition at line 381 of file enum.c.

References enum_values_pack(), Qnil, rb_ary_push(), and rb_thread_check_ints().

Referenced by enum_to_a().

static VALUE collect_i ( VALUE  i,
VALUE  ary,
int  argc,
VALUE argv 
)
static

Definition at line 373 of file enum.c.

References enum_yield, Qnil, and rb_ary_push().

Referenced by enum_collect().

static VALUE count_all_i ( VALUE  i,
VALUE  memop,
int  argc,
VALUE argv 
)
static

Definition at line 118 of file enum.c.

References Qnil.

Referenced by enum_count().

static VALUE count_i ( VALUE  i,
VALUE  memop,
int  argc,
VALUE argv 
)
static

Definition at line 94 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, and rb_equal().

Referenced by enum_count().

static VALUE count_iter_i ( VALUE  i,
VALUE  memop,
int  argc,
VALUE argv 
)
static

Definition at line 107 of file enum.c.

References enum_yield, Qnil, and RTEST.

Referenced by enum_count().

static VALUE cycle_i ( VALUE  i,
VALUE  ary,
int  argc,
VALUE argv 
)
static

Definition at line 2170 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, rb_ary_push(), and rb_yield().

Referenced by enum_cycle().

DEFINE_ENUMFUNCS ( all  )

Definition at line 957 of file enum.c.

References Qfalse, Qnil, rb_iter_break(), result, and RTEST.

DEFINE_ENUMFUNCS ( any  )

Definition at line 992 of file enum.c.

References Qnil, Qtrue, rb_iter_break(), result, and RTEST.

DEFINE_ENUMFUNCS ( one  )

Definition at line 1028 of file enum.c.

References Qfalse, Qnil, Qtrue, Qundef, rb_iter_break(), result, and RTEST.

DEFINE_ENUMFUNCS ( none  )

Definition at line 1070 of file enum.c.

References Qfalse, Qnil, rb_iter_break(), result, and RTEST.

static VALUE drop_i ( VALUE  i,
VALUE arg,
int  argc,
VALUE argv 
)
static

Definition at line 2087 of file enum.c.

References enum_values_pack(), Qnil, and rb_ary_push().

Referenced by enum_drop().

static VALUE drop_while_i ( VALUE  i,
VALUE args,
int  argc,
VALUE argv 
)
static

Definition at line 2128 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, Qtrue, rb_ary_push(), rb_yield(), and RTEST.

Referenced by enum_drop_while().

static VALUE each_cons_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1794 of file enum.c.

References ENUM_WANT_SVALUE, long, Qnil, RARRAY_LEN, rb_ary_dup(), rb_ary_push(), rb_ary_shift(), rb_yield(), size, and v.

Referenced by enum_each_cons().

static VALUE each_slice_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1740 of file enum.c.

References ENUM_WANT_SVALUE, long, Qnil, RARRAY_LEN, rb_ary_new2(), rb_ary_push(), rb_yield(), size, and v.

Referenced by enum_each_slice().

static VALUE each_val_i ( VALUE  i,
VALUE  p,
int  argc,
VALUE argv 
)
static

Definition at line 1695 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, and rb_yield().

Referenced by enum_each_entry().

static VALUE each_with_index_i ( VALUE  i,
VALUE  memo,
int  argc,
VALUE argv 
)
static

Definition at line 1619 of file enum.c.

References enum_values_pack(), INT2NUM(), and rb_yield_values().

Referenced by enum_each_with_index().

static VALUE each_with_object_i ( VALUE  i,
VALUE  memo,
int  argc,
VALUE argv 
)
static

Definition at line 1849 of file enum.c.

References ENUM_WANT_SVALUE, and rb_yield_values().

Referenced by enum_each_with_object().

static VALUE enum_all ( VALUE  obj)
static

Definition at line 984 of file enum.c.

References ENUMFUNC, id_each, Qtrue, rb_block_call, and result.

Referenced by Init_Enumerable().

static VALUE enum_any ( VALUE  obj)
static

Definition at line 1020 of file enum.c.

References ENUMFUNC, id_each, Qfalse, rb_block_call, and result.

Referenced by Init_Enumerable().

static VALUE enum_chunk ( int  argc,
VALUE argv,
VALUE  enumerable 
)
static
static VALUE enum_collect ( VALUE  obj)
static

Definition at line 407 of file enum.c.

References collect_i(), id_each, rb_ary_new(), rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_count ( int  argc,
VALUE argv,
VALUE  obj 
)
static
static VALUE enum_cycle ( int  argc,
VALUE argv,
VALUE  obj 
)
static
static VALUE enum_drop ( VALUE  obj,
VALUE  n 
)
static

Definition at line 2111 of file enum.c.

References args, drop_i(), id_each, len, NUM2LONG(), rb_ary_new(), rb_block_call, rb_eArgError, and rb_raise().

Referenced by Init_Enumerable().

static VALUE enum_drop_while ( VALUE  obj)
static

Definition at line 2158 of file enum.c.

References args, drop_while_i(), id_each, Qfalse, rb_ary_new(), rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_each_cons ( VALUE  obj,
VALUE  n 
)
static
static VALUE enum_each_entry ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 1732 of file enum.c.

References each_val_i(), id_each, rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_each_slice ( VALUE  obj,
VALUE  n 
)
static
static VALUE enum_each_with_index ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 1646 of file enum.c.

References each_with_index_i(), id_each, rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_each_with_object ( VALUE  obj,
VALUE  memo 
)
static

Definition at line 1871 of file enum.c.

References each_with_object_i(), id_each, rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_find ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 204 of file enum.c.

References find_i(), id_each, NIL_P, Qnil, Qundef, rb_block_call, rb_funcall(), rb_intern, rb_scan_args(), and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_find_all ( VALUE  obj)
static

Definition at line 322 of file enum.c.

References find_all_i(), id_each, rb_ary_new(), rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_find_index ( int  argc,
VALUE argv,
VALUE  obj 
)
static
static VALUE enum_first ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 724 of file enum.c.

References first_i(), id_each, len, NUM2LONG(), Qnil, rb_ary_new2(), rb_block_call, rb_eArgError, rb_raise(), and rb_scan_args().

Referenced by Init_Enumerable().

static VALUE enum_flat_map ( VALUE  obj)
static

Definition at line 453 of file enum.c.

References flat_map_i(), id_each, rb_ary_new(), rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_grep ( VALUE  obj,
VALUE  pat 
)
static

Definition at line 80 of file enum.c.

References arg, grep_i(), grep_iter_i(), id_each, rb_ary_new(), rb_block_call, and rb_block_given_p().

Referenced by Init_Enumerable().

static VALUE enum_group_by ( VALUE  obj)
static

Definition at line 672 of file enum.c.

References group_by_i(), hash(), id_each, OBJ_INFECT, rb_block_call, rb_hash_new(), and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_inject ( int  argc,
VALUE argv,
VALUE  obj 
)
static
static VALUE enum_max ( VALUE  obj)
static

Definition at line 1224 of file enum.c.

References id_each, max_i(), max_ii(), Qnil, Qundef, rb_block_call, rb_block_given_p(), and result.

Referenced by Init_Enumerable().

static VALUE enum_max_by ( VALUE  obj)
static

Definition at line 1468 of file enum.c.

References id_each, max_by_i(), Qnil, Qundef, rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_member ( VALUE  obj,
VALUE  val 
)
static

Definition at line 1608 of file enum.c.

References id_each, member_i(), Qfalse, and rb_block_call.

Referenced by Init_Enumerable().

static VALUE enum_min ( VALUE  obj)
static

Definition at line 1157 of file enum.c.

References id_each, min_i(), min_ii(), Qnil, Qundef, rb_block_call, rb_block_given_p(), and result.

Referenced by Init_Enumerable().

static VALUE enum_min_by ( VALUE  obj)
static

Definition at line 1422 of file enum.c.

References id_each, min_by_i(), Qnil, Qundef, rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_minmax ( VALUE  obj)
static
static VALUE enum_minmax_by ( VALUE  obj)
static
static VALUE enum_none ( VALUE  obj)
static

Definition at line 1095 of file enum.c.

References ENUMFUNC, id_each, Qtrue, rb_block_call, and result.

Referenced by Init_Enumerable().

static VALUE enum_one ( VALUE  obj)
static

Definition at line 1061 of file enum.c.

References ENUMFUNC, id_each, one(), Qfalse, Qundef, rb_block_call, and result.

Referenced by Init_Enumerable().

static VALUE enum_partition ( VALUE  obj)
static

Definition at line 623 of file enum.c.

References id_each, partition_i(), rb_ary_new(), rb_assoc_new(), rb_block_call, and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_reject ( VALUE  obj)
static

Definition at line 360 of file enum.c.

References id_each, rb_ary_new(), rb_block_call, reject_i(), and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_reverse_each ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 1677 of file enum.c.

References enum_to_a(), i, RARRAY_LEN, RARRAY_PTR, rb_yield(), and RETURN_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_slice_before ( int  argc,
VALUE argv,
VALUE  enumerable 
)
static
static VALUE enum_sort ( VALUE  obj)
static

Definition at line 767 of file enum.c.

References enum_to_a(), and rb_ary_sort().

Referenced by Init_Enumerable().

static VALUE enum_sort_by ( VALUE  obj)
static
static VALUE enum_take ( VALUE  obj,
VALUE  n 
)
static

Definition at line 2035 of file enum.c.

References args, id_each, len, NUM2LONG(), rb_ary_new(), rb_ary_new2(), rb_block_call, rb_eArgError, rb_raise(), and take_i().

Referenced by Init_Enumerable().

static VALUE enum_take_while ( VALUE  obj)
static

Definition at line 2076 of file enum.c.

References id_each, rb_ary_new(), rb_block_call, RETURN_ENUMERATOR, and take_while_i().

Referenced by Init_Enumerable().

static VALUE enum_to_a ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 476 of file enum.c.

References collect_all(), id_each, OBJ_INFECT, rb_ary_new(), and rb_block_call.

Referenced by enum_reverse_each(), enum_sort(), and Init_Enumerable().

static VALUE enum_values_pack ( int  argc,
VALUE argv 
)
static

Definition at line 24 of file enum.c.

References Qnil, and rb_ary_new4().

Referenced by collect_all(), drop_i(), each_with_index_i(), member_i(), take_i(), take_while_i(), zip_ary(), and zip_i().

static VALUE enum_zip ( int  argc,
VALUE argv,
VALUE  obj 
)
static
static VALUE find_all_i ( VALUE  i,
VALUE  ary,
int  argc,
VALUE argv 
)
static

Definition at line 293 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, rb_ary_push(), rb_yield(), and RTEST.

Referenced by enum_find_all().

static VALUE find_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 173 of file enum.c.

References ENUM_WANT_SVALUE, i, Qnil, rb_iter_break(), rb_yield(), and RTEST.

Referenced by enum_find().

static VALUE find_index_i ( VALUE  i,
VALUE  memop,
int  argc,
VALUE argv 
)
static

Definition at line 222 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, rb_equal(), rb_iter_break(), and UINT2NUM().

Referenced by enum_find_index().

static VALUE find_index_iter_i ( VALUE  i,
VALUE  memop,
int  argc,
VALUE argv 
)
static

Definition at line 237 of file enum.c.

References enum_yield, Qnil, rb_iter_break(), RTEST, and UINT2NUM().

Referenced by enum_find_index().

static VALUE first_i ( VALUE  i,
VALUE params,
int  argc,
VALUE argv 
)
static

Definition at line 686 of file enum.c.

References ENUM_WANT_SVALUE, i, NIL_P, Qnil, rb_ary_push(), and rb_iter_break().

Referenced by enum_first().

static VALUE flat_map_i ( VALUE  i,
VALUE  ary,
int  argc,
VALUE argv 
)
static

Definition at line 420 of file enum.c.

References enum_yield, NIL_P, Qnil, rb_ary_concat(), rb_ary_push(), and rb_check_array_type().

Referenced by enum_flat_map().

static VALUE grep_i ( VALUE  i,
VALUE  args,
int  argc,
VALUE argv 
)
static

Definition at line 38 of file enum.c.

References arg, ENUM_WANT_SVALUE, id_eqq, Qnil, rb_ary_push(), rb_funcall(), and RTEST.

Referenced by enum_grep().

static VALUE grep_iter_i ( VALUE  i,
VALUE  args,
int  argc,
VALUE argv 
)
static

Definition at line 50 of file enum.c.

References arg, ENUM_WANT_SVALUE, id_eqq, Qnil, rb_ary_push(), rb_funcall(), rb_yield(), and RTEST.

Referenced by enum_grep().

static VALUE group_by_i ( VALUE  i,
VALUE  hash,
int  argc,
VALUE argv 
)
static

Definition at line 637 of file enum.c.

References ENUM_WANT_SVALUE, NIL_P, Qnil, rb_ary_new3(), rb_ary_push(), rb_hash_aref(), rb_hash_aset(), and rb_yield().

Referenced by enum_group_by().

void Init_Enumerable ( void  )
static VALUE inject_i ( VALUE  i,
VALUE  p,
int  argc,
VALUE argv 
)
static

Definition at line 487 of file enum.c.

References ENUM_WANT_SVALUE, i, Qnil, Qundef, and rb_yield_values().

Referenced by enum_inject().

static VALUE inject_op_i ( VALUE  i,
VALUE  p,
int  argc,
VALUE argv 
)
static

Definition at line 503 of file enum.c.

References ENUM_WANT_SVALUE, i, Qnil, Qundef, and rb_funcall().

Referenced by enum_inject().

static VALUE max_by_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1435 of file enum.c.

References ENUM_WANT_SVALUE, i, id_cmp, Qnil, Qundef, rb_cmpint(), rb_funcall(), rb_yield(), and v.

Referenced by enum_max_by().

static VALUE max_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1172 of file enum.c.

References cmp, ENUM_WANT_SVALUE, i, id_cmp, Qnil, Qundef, rb_cmpint(), and rb_funcall().

Referenced by enum_max().

static VALUE max_ii ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1191 of file enum.c.

References cmp, ENUM_WANT_SVALUE, i, Qnil, Qundef, rb_cmpint(), and rb_yield_values().

Referenced by enum_max().

static VALUE member_i ( VALUE  iter,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1585 of file enum.c.

References enum_values_pack(), Qnil, Qtrue, rb_equal(), and rb_iter_break().

Referenced by enum_member().

static VALUE min_by_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1389 of file enum.c.

References ENUM_WANT_SVALUE, i, id_cmp, Qnil, Qundef, rb_cmpint(), rb_funcall(), rb_yield(), and v.

Referenced by enum_min_by().

static VALUE min_i ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1104 of file enum.c.

References cmp, ENUM_WANT_SVALUE, i, id_cmp, Qnil, Qundef, rb_cmpint(), and rb_funcall().

Referenced by enum_min().

static VALUE min_ii ( VALUE  i,
VALUE memo,
int  argc,
VALUE argv 
)
static

Definition at line 1123 of file enum.c.

References cmp, ENUM_WANT_SVALUE, i, Qnil, Qundef, rb_cmpint(), and rb_yield_values().

Referenced by enum_min().

static VALUE minmax_by_i ( VALUE  i,
VALUE  _memo,
int  argc,
VALUE argv 
)
static
static void minmax_by_i_update ( VALUE  v1,
VALUE  v2,
VALUE  i1,
VALUE  i2,
struct minmax_by_t memo 
)
static
static VALUE minmax_i ( VALUE  i,
VALUE  _memo,
int  argc,
VALUE argv 
)
static

Definition at line 1266 of file enum.c.

References ENUM_WANT_SVALUE, i, id_cmp, minmax_t::last, minmax_i_update(), Qnil, Qundef, rb_cmpint(), and rb_funcall().

Referenced by enum_minmax().

static void minmax_i_update ( VALUE  i,
VALUE  j,
struct minmax_t memo 
)
static

Definition at line 1245 of file enum.c.

References i, id_cmp, minmax_t::max, minmax_t::min, Qundef, rb_cmpint(), and rb_funcall().

Referenced by enum_minmax(), and minmax_i().

static VALUE minmax_ii ( VALUE  i,
VALUE  _memo,
int  argc,
VALUE argv 
)
static

Definition at line 1318 of file enum.c.

References ENUM_WANT_SVALUE, i, minmax_t::last, minmax_ii_update(), Qnil, Qundef, rb_cmpint(), and rb_yield_values().

Referenced by enum_minmax().

static void minmax_ii_update ( VALUE  i,
VALUE  j,
struct minmax_t memo 
)
static

Definition at line 1297 of file enum.c.

References i, minmax_t::max, minmax_t::min, Qundef, rb_cmpint(), and rb_yield_values().

Referenced by enum_minmax(), and minmax_ii().

static VALUE partition_i ( VALUE  i,
VALUE ary,
int  argc,
VALUE argv 
)
static

Definition at line 594 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, rb_ary_push(), rb_yield(), and RTEST.

Referenced by enum_partition().

static VALUE reject_i ( VALUE  i,
VALUE  ary,
int  argc,
VALUE argv 
)
static

Definition at line 335 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, rb_ary_push(), rb_yield(), and RTEST.

Referenced by enum_reject().

static VALUE slicebefore_i ( VALUE  yielder,
VALUE  enumerator,
int  argc,
VALUE argv 
)
static
static VALUE slicebefore_ii ( VALUE  i,
VALUE  _argp,
int  argc,
VALUE argv 
)
static
static int sort_by_cmp ( const void *  ap,
const void *  bp,
void *  data 
)
static

Definition at line 808 of file enum.c.

References sort_by_data::ary, id_cmp, rb_cmpint(), rb_eRuntimeError, rb_funcall(), rb_raise(), and RBASIC.

Referenced by enum_sort_by().

static VALUE sort_by_i ( VALUE  i,
VALUE  _data,
int  argc,
VALUE argv 
)
static
static VALUE take_i ( VALUE  i,
VALUE arg,
int  argc,
VALUE argv 
)
static

Definition at line 2016 of file enum.c.

References enum_values_pack(), Qnil, rb_ary_push(), and rb_iter_break().

Referenced by enum_take().

static VALUE take_while_i ( VALUE  i,
VALUE ary,
int  argc,
VALUE argv 
)
static

Definition at line 2053 of file enum.c.

References enum_values_pack(), enum_yield, Qnil, rb_ary_push(), rb_iter_break(), and RTEST.

Referenced by enum_take_while().

static VALUE zip_ary ( VALUE  val,
NODE memo,
int  argc,
VALUE argv 
)
static
static VALUE zip_i ( VALUE  val,
NODE memo,
int  argc,
VALUE argv 
)
static

Variable Documentation

ID id_next
static

Definition at line 18 of file enum.c.

Referenced by call_next(), and Init_Enumerable().

VALUE rb_mEnumerable