enum.c File Reference

#include "ruby/ruby.h"
#include "ruby/util.h"
#include "node.h"
#include "id.h"
#include "internal.h"

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

Defines

#define id_each   idEach
#define id_eqq   idEqq
#define id_cmp   idCmp
#define id_lshift   idLTLT
#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

VALUE rb_f_send (int argc, VALUE *argv, VALUE recv)
VALUE rb_enum_values_pack (int argc, const VALUE *argv)
static VALUE grep_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE grep_iter_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_grep (VALUE obj, VALUE pat)
static VALUE count_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE count_iter_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE count_all_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE enum_count (int argc, VALUE *argv, VALUE obj)
static VALUE find_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE enum_find (int argc, VALUE *argv, VALUE obj)
static VALUE find_index_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE find_index_iter_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE enum_find_index (int argc, VALUE *argv, VALUE obj)
static VALUE find_all_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE enum_size (VALUE self, VALUE args, VALUE eobj)
static VALUE enum_find_all (VALUE obj)
static VALUE reject_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE enum_reject (VALUE obj)
static VALUE collect_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE collect_all (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE enum_collect (VALUE obj)
static VALUE flat_map_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE enum_flat_map (VALUE obj)
static VALUE enum_to_a (int argc, VALUE *argv, VALUE obj)
static VALUE enum_to_h_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
static VALUE enum_to_h (int argc, VALUE *argv, VALUE obj)
static VALUE inject_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
static VALUE inject_op_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
static VALUE enum_inject (int argc, VALUE *argv, VALUE obj)
static VALUE partition_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, arys))
static VALUE enum_partition (VALUE obj)
static VALUE group_by_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
static VALUE enum_group_by (VALUE obj)
static VALUE first_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, params))
static VALUE enum_take (VALUE obj, VALUE n)
static VALUE enum_first (int argc, VALUE *argv, VALUE obj)
static VALUE enum_sort (VALUE obj)
static VALUE sort_by_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
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 (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE min_ii (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_min (VALUE obj)
static VALUE max_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE max_ii (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_max (VALUE obj)
 STATIC_ASSERT (minmax_t, sizeof(struct minmax_t)<=sizeof(NODE)-offsetof(NODE, u1))
static void minmax_i_update (VALUE i, VALUE j, struct minmax_t *memo)
static VALUE minmax_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
static void minmax_ii_update (VALUE i, VALUE j, struct minmax_t *memo)
static VALUE minmax_ii (RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
static VALUE enum_minmax (VALUE obj)
static VALUE min_by_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_min_by (VALUE obj)
static VALUE max_by_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
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 (RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
static VALUE enum_minmax_by (VALUE obj)
static VALUE member_i (RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
static VALUE enum_member (VALUE obj, VALUE val)
static VALUE each_with_index_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
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 (RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
static VALUE enum_each_entry (int argc, VALUE *argv, VALUE obj)
static VALUE each_slice_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
static VALUE enum_each_slice_size (VALUE obj, VALUE args, VALUE eobj)
static VALUE enum_each_slice (VALUE obj, VALUE n)
static VALUE each_cons_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_each_cons_size (VALUE obj, VALUE args, VALUE eobj)
static VALUE enum_each_cons (VALUE obj, VALUE n)
static VALUE each_with_object_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
static VALUE enum_each_with_object (VALUE obj, VALUE memo)
static VALUE zip_ary (RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
static VALUE call_next (VALUE *v)
static VALUE call_stop (VALUE *v)
static VALUE zip_i (RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
static VALUE enum_zip (int argc, VALUE *argv, VALUE obj)
static VALUE take_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE take_while_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE enum_take_while (VALUE obj)
static VALUE drop_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_drop (VALUE obj, VALUE n)
static VALUE drop_while_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE enum_drop_while (VALUE obj)
static VALUE cycle_i (RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE enum_cycle_size (VALUE self, VALUE args, VALUE eobj)
static VALUE enum_cycle (int argc, VALUE *argv, VALUE obj)
static VALUE chunk_ii (RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
static VALUE chunk_i (RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
static VALUE enum_chunk (int argc, VALUE *argv, VALUE enumerable)
static VALUE slicebefore_ii (RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
static VALUE slicebefore_i (RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
static VALUE enum_slice_before (int argc, VALUE *argv, VALUE enumerable)
void Init_Enumerable (void)

Variables

VALUE rb_mEnumerable
static ID id_next
static ID id_div
static ID id_call
static ID id_size


Define Documentation

#define DEFINE_ENUMFUNCS ( name   ) 

Value:

static VALUE enum_##name##_func(VALUE result, NODE *memo); \
\
static VALUE \
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(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
    return enum_##name##_func(enum_yield(argc, argv), RNODE(memo));     \
} \
\
static VALUE \
enum_##name##_func(VALUE result, NODE *memo)

Definition at line 1008 of file enum.c.

 
#define ENUM_WANT_SVALUE (  ) 

Value:

do { \
    i = rb_enum_values_pack(argc, argv); \
} while (0)

Definition at line 40 of file enum.c.

Referenced by chunk_ii(), count_i(), cycle_i(), drop_while_i(), each_cons_i(), each_slice_i(), each_val_i(), each_with_object_i(), enum_to_h_i(), find_all_i(), find_i(), find_index_i(), first_i(), grep_i(), grep_iter_i(), group_by_i(), inject_i(), inject_op_i(), max_by_i(), max_i(), max_ii(), min_by_i(), min_i(), min_ii(), minmax_by_i(), minmax_i(), minmax_ii(), partition_i(), reject_i(), slicebefore_ii(), and sort_by_i().

#define enum_yield   rb_yield_values2

Definition at line 44 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 1006 of file enum.c.

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

#define id_cmp   idCmp

Definition at line 29 of file enum.c.

Referenced by cmp(), enum_each_cons_size(), f_cmp(), fix_cmp(), flo_cmp(), Init_Array(), Init_Numeric(), Init_Range(), Init_Rational(), Init_Time(), max_by_i(), max_i(), min_by_i(), min_i(), minmax_by_i(), minmax_by_i_update(), minmax_i(), minmax_i_update(), nurat_cmp(), r_le(), r_lt(), range_bsearch(), range_check(), range_max(), range_min(), rb_ary_bsearch(), recursive_cmp(), ruby_num_interval_step_size(), sort_2(), sort_by_cmp(), and wcmp().

#define id_each   idEach

Definition at line 27 of file enum.c.

Referenced by chunk_i(), enum_all(), enum_any(), enum_collect(), enum_count(), enum_cycle(), enum_drop(), enum_drop_while(), enum_each_cons(), enum_each_entry(), enum_each_slice(), enum_each_with_index(), enum_each_with_object(), enum_find(), enum_find_all(), enum_find_index(), enum_first(), enum_flat_map(), enum_grep(), enum_group_by(), enum_inject(), enum_max(), enum_max_by(), enum_member(), enum_min(), enum_min_by(), enum_minmax(), enum_minmax_by(), enum_none(), enum_one(), enum_partition(), enum_reject(), enum_sort_by(), enum_take(), enum_take_while(), enum_to_a(), enum_to_h(), enum_zip(), Init_Enumerator(), lazy_flat_map_each(), lazy_flat_map_func(), lazy_init_block_i(), lazy_zip(), next_i(), and slicebefore_i().

#define id_eqq   idEqq

Definition at line 28 of file enum.c.

Referenced by grep_i(), grep_iter_i(), Init_Enumerator(), lazy_grep_func(), lazy_grep_iter(), and slicebefore_ii().

#define id_lshift   idLTLT

Definition at line 30 of file enum.c.

Referenced by chunk_i(), chunk_ii(), Init_Time(), slicebefore_i(), and slicebefore_ii().

#define rb_intern ( str   )     rb_intern_const(str)

#define SORT_BY_BUFSIZE   16

Definition at line 833 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 2017 of file enum.c.

References id_next, and rb_funcall().

Referenced by lazy_zip_func(), and zip_i().

static VALUE call_stop ( VALUE *  v  )  [static]

Definition at line 2023 of file enum.c.

References Qundef.

Referenced by zip_i().

static VALUE chunk_i ( RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator  )  [static]

Definition at line 2424 of file enum.c.

References chunk_arg::categorize, chunk_ii(), id_each, id_lshift, MEMO_FOR, NEW_MEMO_FOR, NIL_P, chunk_arg::prev_elts, chunk_arg::prev_value, Qnil, rb_assoc_new(), rb_block_call(), rb_funcall(), rb_intern, rb_ivar_get(), rb_obj_dup(), chunk_arg::state, VALUE, and chunk_arg::yielder.

Referenced by enum_chunk().

static VALUE chunk_ii ( RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp)   )  [static]

Definition at line 2374 of file enum.c.

References chunk_arg::categorize, ENUM_WANT_SVALUE, ID2SYM, id_call, id_lshift, MEMO_FOR, NIL_P, chunk_arg::prev_elts, chunk_arg::prev_value, Qnil, rb_ary_new3, rb_ary_push(), rb_assoc_new(), rb_equal(), rb_eRuntimeError, rb_funcall(), rb_id2name(), rb_intern, rb_raise(), separator, chunk_arg::state, SYM2ID, SYMBOL_P, VALUE, and chunk_arg::yielder.

Referenced by chunk_i().

static VALUE collect_all ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 403 of file enum.c.

References argc, argv, Qnil, rb_ary_push(), rb_enum_values_pack(), and rb_thread_check_ints().

Referenced by enum_to_a().

static VALUE collect_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 395 of file enum.c.

References argc, argv, enum_yield, Qnil, and rb_ary_push().

Referenced by enum_collect().

static VALUE count_all_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)   )  [static]

Definition at line 124 of file enum.c.

References RNode::cnt, Qnil, RNODE, and RNode::u3.

Referenced by enum_count().

static VALUE count_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)   )  [static]

Definition at line 100 of file enum.c.

References RNode::cnt, ENUM_WANT_SVALUE, Qnil, rb_equal(), RNODE, RNode::u1, RNode::u3, and RNode::value.

Referenced by enum_count().

static VALUE count_iter_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)   )  [static]

Definition at line 113 of file enum.c.

References argc, argv, RNode::cnt, enum_yield, Qnil, RNODE, RTEST, and RNode::u3.

Referenced by enum_count().

static VALUE cycle_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 2287 of file enum.c.

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

Referenced by enum_cycle().

DEFINE_ENUMFUNCS ( none   ) 

Definition at line 1138 of file enum.c.

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

DEFINE_ENUMFUNCS ( one   ) 

Definition at line 1094 of file enum.c.

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

DEFINE_ENUMFUNCS ( any   ) 

Definition at line 1060 of file enum.c.

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

DEFINE_ENUMFUNCS ( all   ) 

Definition at line 1026 of file enum.c.

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

static VALUE drop_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 2200 of file enum.c.

References argc, args, argv, RNode::cnt, Qnil, rb_ary_push(), rb_enum_values_pack(), RNODE, RNode::u1, RNode::u3, and RNode::value.

Referenced by enum_drop().

static VALUE drop_while_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 2243 of file enum.c.

References args, ENUM_WANT_SVALUE, Qnil, rb_ary_push(), rb_yield(), RNODE, RTEST, RNode::state, TRUE, RNode::u1, RNode::u3, and RNode::value.

Referenced by enum_drop_while().

static VALUE each_cons_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1887 of file enum.c.

References args, RNode::cnt, ENUM_WANT_SVALUE, Qnil, RARRAY_LEN, rb_ary_dup(), rb_ary_push(), rb_ary_shift(), rb_yield(), RNODE, size, RNode::u1, RNode::u3, RNode::value, and VALUE.

Referenced by enum_each_cons().

static VALUE each_slice_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, m)   )  [static]

Definition at line 1820 of file enum.c.

References RNode::cnt, ENUM_WANT_SVALUE, Qnil, RARRAY_LEN, rb_ary_new2, rb_ary_push(), rb_yield(), RNODE, size, RNode::u1, RNode::u3, RNode::value, and VALUE.

Referenced by enum_each_slice().

static VALUE each_val_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, p)   )  [static]

Definition at line 1775 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, and rb_yield().

Referenced by enum_each_entry().

static VALUE each_with_index_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)   )  [static]

Definition at line 1699 of file enum.c.

References argc, argv, INT2NUM, rb_enum_values_pack(), rb_yield_values(), and RNODE.

Referenced by enum_each_with_index().

static VALUE each_with_object_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)   )  [static]

Definition at line 1955 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 1053 of file enum.c.

References ENUMFUNC, id_each, NEW_MEMO, Qtrue, rb_block_call(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_any ( VALUE  obj  )  [static]

Definition at line 1087 of file enum.c.

References ENUMFUNC, id_each, NEW_MEMO, Qfalse, rb_block_call(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_chunk ( int  argc,
VALUE *  argv,
VALUE  enumerable 
) [static]

Definition at line 2542 of file enum.c.

References chunk_i(), rb_block_call(), rb_block_given_p(), rb_block_proc(), rb_cEnumerator, rb_eArgError, rb_intern, rb_ivar_set(), rb_obj_alloc(), rb_raise(), rb_scan_args(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_collect ( VALUE  obj  )  [static]

Definition at line 429 of file enum.c.

References collect_i(), enum_size(), id_each, rb_ary_new(), rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_count ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 151 of file enum.c.

References count_all_i(), count_i(), count_iter_i(), func, id_each, INT2NUM, NEW_MEMO, Qnil, rb_block_call(), rb_block_given_p(), rb_scan_args(), rb_warn(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_cycle ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 2336 of file enum.c.

References cycle_i(), enum_cycle_size(), id_each, len, NIL_P, NUM2LONG, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_new(), rb_block_call(), rb_scan_args(), rb_yield(), RBASIC_CLEAR_CLASS, RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_cycle_size ( VALUE  self,
VALUE  args,
VALUE  eobj 
) [static]

Definition at line 2297 of file enum.c.

References DBL2NUM, enum_size(), INFINITY, INT2FIX, LONG2FIX, mul, NUM2LONG, Qnil, RARRAY_AREF, RARRAY_LEN, rb_funcall(), size, and VALUE.

Referenced by enum_cycle().

static VALUE enum_drop ( VALUE  obj,
VALUE  n 
) [static]

Definition at line 2225 of file enum.c.

References drop_i(), id_each, len, NEW_MEMO, NUM2LONG, rb_ary_new(), rb_block_call(), rb_eArgError, rb_raise(), result, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_drop_while ( VALUE  obj  )  [static]

Definition at line 2274 of file enum.c.

References drop_while_i(), FALSE, id_each, NEW_MEMO, rb_ary_new(), rb_block_call(), result, RETURN_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_each_cons ( VALUE  obj,
VALUE  n 
) [static]

Definition at line 1941 of file enum.c.

References each_cons_i(), enum_each_cons_size(), id_each, NEW_MEMO, NUM2LONG, Qnil, rb_ary_new2, rb_block_call(), rb_eArgError, rb_raise(), RETURN_SIZED_ENUMERATOR, size, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_each_cons_size ( VALUE  obj,
VALUE  args,
VALUE  eobj 
) [static]

Definition at line 1906 of file enum.c.

References enum_size(), id_cmp, LONG2FIX, LONG2NUM, NUM2LONG, Qnil, RARRAY_AREF, rb_cmpint(), rb_eArgError, rb_funcall(), rb_raise(), size, and VALUE.

Referenced by enum_each_cons().

static VALUE enum_each_entry ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 1812 of file enum.c.

References each_val_i(), enum_size(), id_each, rb_block_call(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_each_slice ( VALUE  obj,
VALUE  n 
) [static]

Definition at line 1869 of file enum.c.

References each_slice_i(), enum_each_slice_size(), id_each, NEW_MEMO, NUM2LONG, Qnil, RARRAY_LEN, rb_ary_new2, rb_block_call(), rb_eArgError, rb_raise(), rb_yield(), RETURN_SIZED_ENUMERATOR, size, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_each_slice_size ( VALUE  obj,
VALUE  args,
VALUE  eobj 
) [static]

Definition at line 1839 of file enum.c.

References enum_size(), id_div, LONG2FIX, LONG2NUM, NUM2LONG, Qnil, RARRAY_AREF, rb_eArgError, rb_funcall(), rb_raise(), size, and VALUE.

Referenced by enum_each_slice().

static VALUE enum_each_with_index ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 1726 of file enum.c.

References each_with_index_i(), enum_size(), id_each, NEW_MEMO, rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_each_with_object ( VALUE  obj,
VALUE  memo 
) [static]

Definition at line 1976 of file enum.c.

References each_with_object_i(), enum_size(), id_each, rb_block_call(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_Enumerable().

static VALUE enum_find ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 212 of file enum.c.

References find_i(), id_call, id_each, NEW_MEMO, NIL_P, Qnil, Qundef, rb_block_call(), rb_funcall(), rb_scan_args(), RETURN_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_find_all ( VALUE  obj  )  [static]

Definition at line 341 of file enum.c.

References enum_size(), find_all_i(), id_each, rb_ary_new(), rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_find_index ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 278 of file enum.c.

References find_index_i(), find_index_iter_i(), func, id_each, NEW_MEMO, Qnil, rb_block_call(), rb_block_given_p(), rb_scan_args(), rb_warn(), RETURN_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_first ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 795 of file enum.c.

References enum_take(), first_i(), id_each, NEW_MEMO, Qnil, rb_block_call(), rb_check_arity, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_flat_map ( VALUE  obj  )  [static]

Definition at line 476 of file enum.c.

References enum_size(), flat_map_i(), id_each, rb_ary_new(), rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_grep ( VALUE  obj,
VALUE  pat 
) [static]

Definition at line 89 of file enum.c.

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

Referenced by Init_Enumerable().

static VALUE enum_group_by ( VALUE  obj  )  [static]

Definition at line 751 of file enum.c.

References enum_size(), group_by_i(), hash(), id_each, OBJ_INFECT, rb_block_call(), rb_hash_new(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_inject ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 636 of file enum.c.

References id, ID2SYM, id_each, inject_i(), inject_op_i(), NEW_MEMO, Qnil, rb_block_call(), rb_block_given_p(), rb_check_id(), rb_scan_args(), rb_warning(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_max ( VALUE  obj  )  [static]

Definition at line 1297 of file enum.c.

References id_each, max_i(), max_ii(), NEW_MEMO, Qnil, Qundef, rb_block_call(), rb_block_given_p(), result, RNode::u1, RNode::value, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_max_by ( VALUE  obj  )  [static]

Definition at line 1547 of file enum.c.

References enum_size(), id_each, max_by_i(), NEW_MEMO, Qnil, Qundef, rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_member ( VALUE  obj,
VALUE  val 
) [static]

Definition at line 1690 of file enum.c.

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

Referenced by Init_Enumerable().

static VALUE enum_min ( VALUE  obj  )  [static]

Definition at line 1226 of file enum.c.

References id_each, min_i(), min_ii(), NEW_MEMO, Qnil, Qundef, rb_block_call(), rb_block_given_p(), result, RNode::u1, RNode::value, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_min_by ( VALUE  obj  )  [static]

Definition at line 1501 of file enum.c.

References enum_size(), id_each, min_by_i(), NEW_MEMO, Qnil, Qundef, rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_minmax ( VALUE  obj  )  [static]

Definition at line 1441 of file enum.c.

References id_each, minmax_t::last, minmax_t::max, minmax_t::min, minmax_i(), minmax_i_update(), minmax_ii(), minmax_ii_update(), NEW_MEMO, Qnil, Qundef, rb_ary_new3, rb_ary_store(), rb_block_call(), rb_block_given_p(), RNode::u1, VALUE, and RNode::value.

Referenced by Init_Enumerable().

static VALUE enum_minmax_by ( VALUE  obj  )  [static]

Definition at line 1644 of file enum.c.

References enum_size(), id_each, minmax_by_t::last, minmax_by_t::last_bv, minmax_by_t::max, minmax_by_t::max_bv, MEMO_FOR, minmax_by_t::min, minmax_by_t::min_bv, minmax_by_i(), minmax_by_i_update(), NEW_MEMO_FOR, Qnil, Qundef, rb_assoc_new(), rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_none ( VALUE  obj  )  [static]

Definition at line 1163 of file enum.c.

References ENUMFUNC, id_each, NEW_MEMO, none, Qtrue, rb_block_call(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_one ( VALUE  obj  )  [static]

Definition at line 1127 of file enum.c.

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

Referenced by Init_Enumerable().

static VALUE enum_partition ( VALUE  obj  )  [static]

Definition at line 703 of file enum.c.

References enum_size(), id_each, NEW_MEMO, partition_i(), rb_ary_new(), rb_assoc_new(), rb_block_call(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_reject ( VALUE  obj  )  [static]

Definition at line 382 of file enum.c.

References enum_size(), id_each, rb_ary_new(), rb_block_call(), reject_i(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_reverse_each ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 1757 of file enum.c.

References enum_size(), enum_to_a(), RARRAY_AREF, RARRAY_LEN, rb_yield(), RETURN_SIZED_ENUMERATOR, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_size ( VALUE  self,
VALUE  args,
VALUE  eobj 
) [static]

Definition at line 313 of file enum.c.

References id_size, Qnil, Qundef, rb_check_funcall(), and VALUE.

Referenced by enum_collect(), enum_cycle_size(), enum_each_cons_size(), enum_each_entry(), enum_each_slice_size(), enum_each_with_index(), enum_each_with_object(), enum_find_all(), enum_flat_map(), enum_group_by(), enum_max_by(), enum_min_by(), enum_minmax_by(), enum_partition(), enum_reject(), enum_reverse_each(), enum_sort_by(), lazy_size(), and lazyenum_size().

static VALUE enum_slice_before ( int  argc,
VALUE *  argv,
VALUE  enumerable 
) [static]

Definition at line 2759 of file enum.c.

References rb_block_call(), rb_block_given_p(), rb_block_proc(), rb_cEnumerator, rb_intern, rb_ivar_set(), rb_obj_alloc(), rb_scan_args(), slicebefore_arg::sep_pat, slicebefore_i(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_sort ( VALUE  obj  )  [static]

Definition at line 828 of file enum.c.

References enum_to_a(), and rb_ary_sort().

Referenced by Init_Enumerable().

static VALUE enum_sort_by ( VALUE  obj  )  [static]

Definition at line 957 of file enum.c.

References sort_by_data::ary, sort_by_data::buf, buf, enum_size(), id_each, LONG_MAX, sort_by_data::n, NEW_MEMO, OBJ_INFECT, Qnil, RARRAY_AREF, RARRAY_ASET, RARRAY_LEN, RARRAY_PTR_USE, rb_ary_concat(), rb_ary_new(), rb_ary_new2, rb_ary_resize(), rb_ary_store(), rb_ary_tmp_new(), rb_block_call(), rb_cArray, rb_eRuntimeError, rb_raise(), RB_TYPE_P, RBASIC, RBASIC_CLEAR_CLASS, RBASIC_SET_CLASS_RAW, RETURN_SIZED_ENUMERATOR, ruby_qsort(), SORT_BY_BUFSIZE, sort_by_cmp(), sort_by_i(), T_ARRAY, RNode::u1, and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_take ( VALUE  obj,
VALUE  n 
) [static]

Definition at line 2147 of file enum.c.

References id_each, len, NEW_MEMO, NUM2LONG, rb_ary_new2, rb_block_call(), rb_eArgError, rb_raise(), result, take_i(), and VALUE.

Referenced by enum_first(), and Init_Enumerable().

static VALUE enum_take_while ( VALUE  obj  )  [static]

Definition at line 2189 of file enum.c.

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

Referenced by Init_Enumerable().

static VALUE enum_to_a ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 502 of file enum.c.

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

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

static VALUE enum_to_h ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 543 of file enum.c.

References enum_to_h_i(), hash(), id_each, OBJ_INFECT, rb_block_call(), rb_hash_new(), and VALUE.

Referenced by Init_Enumerable().

static VALUE enum_to_h_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)   )  [static]

Definition at line 513 of file enum.c.

References ENUM_WANT_SVALUE, hash(), NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_builtin_class_name(), rb_check_array_type(), rb_eArgError, rb_eTypeError, rb_hash_aset(), rb_raise(), rb_thread_check_ints(), and VALUE.

Referenced by enum_to_h().

static VALUE enum_zip ( int  argc,
VALUE *  argv,
VALUE  obj 
) [static]

Definition at line 2088 of file enum.c.

References args, CONST_ID, FALSE, ID2SYM, id_each, NIL_P, NODE_DOT2, Qnil, RARRAY_PTR, rb_ary_new(), rb_ary_new4, rb_block_call(), rb_block_given_p(), rb_check_array_type(), rb_eTypeError, rb_funcall(), rb_node_newnode, rb_obj_classname(), rb_raise(), rb_respond_to(), result, TRUE, VALUE, zip_ary(), and zip_i().

Referenced by Init_Enumerable().

static VALUE find_all_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 302 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 ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)   )  [static]

Definition at line 179 of file enum.c.

References RNode::cnt, ENUM_WANT_SVALUE, Qnil, rb_iter_break(), rb_yield(), RNODE, RTEST, RNode::u1, RNode::u3, and RNode::value.

Referenced by enum_find().

static VALUE find_index_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)   )  [static]

Definition at line 231 of file enum.c.

References RNode::cnt, ENUM_WANT_SVALUE, Qnil, rb_equal(), rb_iter_break(), RNODE, RNode::u1, RNode::u2, RNode::u3, UINT2NUM, and RNode::value.

Referenced by enum_find_index().

static VALUE find_index_iter_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)   )  [static]

Definition at line 246 of file enum.c.

References argc, argv, RNode::cnt, enum_yield, Qnil, rb_iter_break(), RNODE, RTEST, RNode::u1, RNode::u3, UINT2NUM, and RNode::value.

Referenced by enum_find_index().

static VALUE first_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, params)   )  [static]

Definition at line 765 of file enum.c.

References ENUM_WANT_SVALUE, rb_iter_break(), RNODE, RNode::u1, UNREACHABLE, and RNode::value.

Referenced by enum_first(), and range_first().

static VALUE flat_map_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 442 of file enum.c.

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

Referenced by enum_flat_map().

static VALUE grep_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 47 of file enum.c.

References args, ENUM_WANT_SVALUE, id_eqq, Qnil, rb_ary_push(), rb_funcall(), RNODE, RTEST, RNode::u1, RNode::u2, and RNode::value.

Referenced by enum_grep().

static VALUE grep_iter_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 59 of file enum.c.

References args, ENUM_WANT_SVALUE, id_eqq, Qnil, rb_ary_push(), rb_funcall(), rb_yield(), RNODE, RTEST, RNode::u1, RNode::u2, and RNode::value.

Referenced by enum_grep().

static VALUE group_by_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)   )  [static]

Definition at line 716 of file enum.c.

References ENUM_WANT_SVALUE, hash(), Qnil, rb_ary_new3, rb_ary_push(), rb_hash_aref(), rb_hash_aset(), RB_TYPE_P, rb_yield(), T_ARRAY, and VALUE.

Referenced by enum_group_by().

void Init_Enumerable ( void   ) 

Definition at line 2793 of file enum.c.

References enum_all(), enum_any(), enum_chunk(), enum_collect(), enum_count(), enum_cycle(), enum_drop(), enum_drop_while(), enum_each_cons(), enum_each_entry(), enum_each_slice(), enum_each_with_index(), enum_each_with_object(), enum_find(), enum_find_all(), enum_find_index(), enum_first(), enum_flat_map(), enum_grep(), enum_group_by(), enum_inject(), enum_max(), enum_max_by(), enum_member(), enum_min(), enum_min_by(), enum_minmax(), enum_minmax_by(), enum_none(), enum_one(), enum_partition(), enum_reject(), enum_reverse_each(), enum_slice_before(), enum_sort(), enum_sort_by(), enum_take(), enum_take_while(), enum_to_a(), enum_to_h(), enum_zip(), id_call, id_div, id_next, id_size, rb_define_method(), rb_define_module(), rb_intern, and rb_mEnumerable.

static VALUE inject_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, p)   )  [static]

Definition at line 552 of file enum.c.

References RNode::argc, ENUM_WANT_SVALUE, Qnil, rb_yield_values(), RNODE, RNode::u1, RNode::u2, and RNode::value.

Referenced by enum_inject().

static VALUE inject_op_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, p)   )  [static]

Definition at line 569 of file enum.c.

References RNode::argc, args, ENUM_WANT_SVALUE, name, numberof, Qnil, rb_f_send(), rb_funcall(), RNODE, SYM2ID, SYMBOL_P, RNode::u1, RNode::u2, RNode::u3, RNode::value, and VALUE.

Referenced by enum_inject().

static VALUE max_by_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1513 of file enum.c.

References args, ENUM_WANT_SVALUE, id_cmp, Qnil, Qundef, rb_cmpint(), rb_funcall(), rb_yield(), RNODE, RNode::u1, RNode::u2, RNode::value, and VALUE.

Referenced by enum_max_by().

static VALUE max_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1243 of file enum.c.

References args, cmp, ENUM_WANT_SVALUE, id_cmp, Qnil, Qundef, rb_cmpint(), rb_funcall(), RNODE, RNode::u1, RNode::value, and VALUE.

Referenced by enum_max().

static VALUE max_ii ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1263 of file enum.c.

References args, cmp, ENUM_WANT_SVALUE, Qnil, Qundef, rb_cmpint(), rb_yield_values(), RNODE, RNode::u1, RNode::value, and VALUE.

Referenced by enum_max().

static VALUE member_i ( RB_BLOCK_CALL_FUNC_ARGLIST(iter, args  )  [static]

Definition at line 1665 of file enum.c.

References argc, args, argv, Qnil, Qtrue, rb_enum_values_pack(), rb_equal(), rb_iter_break(), RNODE, RNode::u1, RNode::u2, and RNode::value.

Referenced by enum_member().

static VALUE min_by_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1467 of file enum.c.

References args, ENUM_WANT_SVALUE, id_cmp, Qnil, Qundef, rb_cmpint(), rb_funcall(), rb_yield(), RNODE, RNode::u1, RNode::u2, RNode::value, and VALUE.

Referenced by enum_min_by().

static VALUE min_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1171 of file enum.c.

References args, cmp, ENUM_WANT_SVALUE, id_cmp, Qnil, Qundef, rb_cmpint(), rb_funcall(), RNODE, RNode::u1, RNode::value, and VALUE.

Referenced by enum_min().

static VALUE min_ii ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 1191 of file enum.c.

References args, cmp, ENUM_WANT_SVALUE, Qnil, Qundef, rb_cmpint(), rb_yield_values(), RNODE, RNode::u1, RNode::value, and VALUE.

Referenced by enum_min().

static VALUE minmax_by_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo)   )  [static]

Definition at line 1589 of file enum.c.

References ENUM_WANT_SVALUE, id_cmp, minmax_by_t::last, minmax_by_t::last_bv, MEMO_FOR, minmax_by_i_update(), Qnil, Qundef, rb_cmpint(), rb_funcall(), rb_yield(), and VALUE.

Referenced by enum_minmax_by().

static void minmax_by_i_update ( VALUE  v1,
VALUE  v2,
VALUE  i1,
VALUE  i2,
struct minmax_by_t memo 
) [static]

Definition at line 1568 of file enum.c.

References id_cmp, minmax_by_t::max, minmax_by_t::max_bv, minmax_by_t::min, minmax_by_t::min_bv, Qundef, rb_cmpint(), and rb_funcall().

Referenced by enum_minmax_by(), and minmax_by_i().

static VALUE minmax_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo)   )  [static]

Definition at line 1343 of file enum.c.

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

Referenced by enum_minmax().

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

Definition at line 1322 of file enum.c.

References 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 ( RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo)   )  [static]

Definition at line 1395 of file enum.c.

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

Referenced by enum_minmax().

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

Definition at line 1374 of file enum.c.

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

Referenced by enum_minmax(), and minmax_ii().

static VALUE partition_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, arys)   )  [static]

Definition at line 671 of file enum.c.

References ENUM_WANT_SVALUE, Qnil, rb_ary_push(), rb_yield(), RNODE, RTEST, RNode::u1, RNode::u2, RNode::value, and VALUE.

Referenced by enum_partition().

VALUE rb_enum_values_pack ( int  argc,
const VALUE *  argv 
)

Definition at line 33 of file enum.c.

References Qnil, and rb_ary_new4.

Referenced by collect_all(), drop_i(), each_with_index_i(), lazy_grep_func(), lazy_grep_iter(), lazy_reject_func(), lazy_select_func(), member_i(), take_i(), take_while_i(), zip_ary(), and zip_i().

VALUE rb_f_send ( int  argc,
VALUE *  argv,
VALUE  recv 
)

Definition at line 908 of file vm_eval.c.

References CALL_FCALL, and send_internal().

Referenced by Init_vm_eval(), and inject_op_i().

static VALUE reject_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 354 of file enum.c.

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

Referenced by enum_reject(), and rb_hash_reject().

static VALUE slicebefore_i ( RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator  )  [static]

Definition at line 2598 of file enum.c.

References id_each, id_lshift, MEMO_FOR, NEW_MEMO_FOR, NIL_P, slicebefore_arg::prev_elts, Qnil, rb_attr_get(), rb_block_call(), rb_funcall(), rb_intern, rb_ivar_get(), rb_obj_dup(), slicebefore_arg::sep_pat, slicebefore_arg::sep_pred, slicebefore_ii(), slicebefore_arg::state, VALUE, and slicebefore_arg::yielder.

Referenced by enum_slice_before().

static VALUE slicebefore_ii ( RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp)   )  [static]

Definition at line 2569 of file enum.c.

References ENUM_WANT_SVALUE, id_call, id_eqq, id_lshift, MEMO_FOR, NIL_P, slicebefore_arg::prev_elts, Qnil, rb_ary_new3, rb_ary_push(), rb_funcall(), RTEST, slicebefore_arg::sep_pat, slicebefore_arg::sep_pred, slicebefore_arg::state, VALUE, and slicebefore_arg::yielder.

Referenced by slicebefore_i().

static int sort_by_cmp ( const void *  ap,
const void *  bp,
void *  data 
) [static]

Definition at line 869 of file enum.c.

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

Referenced by enum_sort_by().

static VALUE sort_by_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, _data)   )  [static]

Definition at line 841 of file enum.c.

References sort_by_data::ary, sort_by_data::buf, ENUM_WANT_SVALUE, sort_by_data::n, Qnil, RARRAY_ASET, RARRAY_LEN, rb_ary_concat(), rb_eRuntimeError, rb_raise(), rb_yield(), RBASIC, RNODE, SORT_BY_BUFSIZE, and VALUE.

STATIC_ASSERT ( minmax_t  ,
sizeof(struct minmax_t)<=sizeof(NODE)-offsetof(NODE, u1)   
)

static VALUE take_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, args  )  [static]

Definition at line 2127 of file enum.c.

References argc, args, argv, RNode::cnt, Qnil, rb_ary_push(), rb_enum_values_pack(), rb_iter_break(), RNODE, RNode::u1, RNode::u3, and RNode::value.

static VALUE take_while_i ( RB_BLOCK_CALL_FUNC_ARGLIST(i, ary)   )  [static]

Definition at line 2166 of file enum.c.

References argc, argv, enum_yield, Qnil, rb_ary_push(), rb_enum_values_pack(), rb_iter_break(), and RTEST.

Referenced by enum_take_while().

static VALUE zip_ary ( RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval)   )  [static]

Definition at line 1986 of file enum.c.

References argc, args, argv, RNode::cnt, NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_new2, rb_ary_push(), rb_ary_store(), rb_enum_values_pack(), rb_yield(), result, RNode::u1, RNode::u2, RNode::u3, RNode::value, and VALUE.

Referenced by enum_zip().

static VALUE zip_i ( RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval)   )  [static]

Definition at line 2029 of file enum.c.

References argc, args, argv, call_next(), call_stop(), NIL_P, Qnil, Qundef, RARRAY_AREF, RARRAY_ASET, RARRAY_LEN, rb_ary_new2, rb_ary_push(), rb_ary_store(), rb_enum_values_pack(), rb_eStopIteration, rb_rescue2(), rb_yield(), result, RNode::u1, RNode::u2, RNode::value, and VALUE.

Referenced by enum_zip().


Variable Documentation

ID id_call [static]

Definition at line 24 of file enum.c.

Referenced by chunk_ii(), enum_find(), enumerator_initialize(), enumerator_size(), Init_Enumerable(), Init_Enumerator(), and slicebefore_ii().

ID id_div [static]

Definition at line 23 of file enum.c.

ID id_next [static]

Definition at line 22 of file enum.c.

Referenced by call_next(), Init_Enumerable(), and Init_Enumerator().

ID id_size [static]

Definition at line 25 of file enum.c.

Referenced by enum_size(), Init_Enumerable(), and Init_Enumerator().

VALUE rb_mEnumerable

Definition at line 20 of file enum.c.

Referenced by Init_Array(), Init_dbm(), Init_Dir(), Init_Enumerable(), Init_etc(), Init_GC(), Init_gdbm(), Init_Hash(), Init_IO(), Init_ossl_asn1(), Init_Range(), Init_readline(), Init_sdbm(), Init_stringio(), Init_Struct(), Init_zlib(), and InitVM_Enumerator().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7