24#include "internal/error.h"
127static VALUE rb_cLazy;
128static ID id_rewind, id_new, id_to_enum;
129static ID id_next, id_result, id_receiver, id_arguments, id_memo, id_method, id_force;
130static ID id_begin, id_end, id_step, id_exclude_end;
131static VALUE sym_each, sym_cycle, sym_yield;
133static VALUE lazy_use_super_method;
135#define id_call idCall
136#define id_each idEach
138#define id_initialize idInitialize
139#define id_size idSize
158static VALUE rb_cGenerator, rb_cYielder, rb_cEnumProducer;
190static VALUE rb_cEnumChain;
203enumerator_mark(
void *p)
218enumerator_compact(
void *p)
232#define enumerator_free RUBY_TYPED_DEFAULT_FREE
235enumerator_memsize(
const void *p)
264proc_entry_mark(
void *p)
272proc_entry_compact(
void *p)
279#define proc_entry_free RUBY_TYPED_DEFAULT_FREE
282proc_entry_memsize(
const void *p)
385enumerator_allocate(
VALUE klass)
424convert_to_feasible_size_value(
VALUE obj)
469 VALUE recv = generator_init(generator_allocate(rb_cGenerator), iter);
471 VALUE size = convert_to_feasible_size_value(arg0);
473 return enumerator_init(
obj, recv, sym_each, 0, 0, 0,
size,
false);
483 ptr0 = enumerator_ptr(orig);
601#if SIZEOF_INT < SIZEOF_LONG
616 return enumerator_block_call(
obj, 0,
obj);
622 struct MEMO *memo = (
struct MEMO *)m;
633enumerator_size(
VALUE obj);
638 return enumerator_size(obj);
661 return enumerator_block_call(obj, enumerator_with_index_i, (
VALUE)
MEMO_NEW(memo, 0, 0));
675enumerator_each_with_index(
VALUE obj)
677 return enumerator_with_index(0,
NULL, obj);
722 enumerator_block_call(obj, enumerator_with_object_i, memo);
845 return get_next_values(
obj, e);
891 VALUE vs = enumerator_next_values(
obj);
892 return ary2sv(vs, 0);
969 VALUE vs = enumerator_peek_values(
obj);
970 return ary2sv(vs, 1);
1081 eobj = generator_ptr(e->
obj)->
obj;
1115 *(
int *)arg =
FALSE;
1130 VALUE method, eargs;
1134 if (!
NIL_P(method)) {
1147 eargs = default_args;
1225 receiver = (*size_fn)(
proc, receiver);
1246yielder_mark(
void *p)
1253yielder_compact(
void *p)
1259#define yielder_free RUBY_TYPED_DEFAULT_FREE
1262yielder_memsize(
const void *p)
1264 return sizeof(
struct yielder);
1279yielder_ptr(
VALUE obj)
1292yielder_allocate(
VALUE klass)
1321yielder_initialize(
VALUE obj)
1361yielder_to_proc(
VALUE obj)
1377 return yielder_init(yielder_allocate(rb_cYielder),
rb_proc_new(yielder_yield_i, 0));
1384generator_mark(
void *p)
1392generator_compact(
void *p)
1399#define generator_free RUBY_TYPED_DEFAULT_FREE
1402generator_memsize(
const void *p)
1432generator_allocate(
VALUE klass)
1476 "wrong argument type %"PRIsVALUE" (expected Proc)",
1480 rb_warn(
"given block not used");
1484 return generator_init(
obj,
proc);
1495 ptr0 = generator_ptr(orig);
1525enum_size(
VALUE self)
1534 return enum_size(self);
1537#define lazy_receiver_size lazy_map_size
1572#define memo_value v2
1573#define memo_flags u3.state
1574#define LAZY_MEMO_BREAK 1
1575#define LAZY_MEMO_PACKED 2
1576#define LAZY_MEMO_BREAK_P(memo) ((memo)->memo_flags & LAZY_MEMO_BREAK)
1577#define LAZY_MEMO_PACKED_P(memo) ((memo)->memo_flags & LAZY_MEMO_PACKED)
1578#define LAZY_MEMO_SET_BREAK(memo) ((memo)->memo_flags |= LAZY_MEMO_BREAK)
1579#define LAZY_MEMO_RESET_BREAK(memo) ((memo)->memo_flags &= ~LAZY_MEMO_BREAK)
1580#define LAZY_MEMO_SET_VALUE(memo, value) MEMO_V2_SET(memo, value)
1581#define LAZY_MEMO_SET_PACKED(memo) ((memo)->memo_flags |= LAZY_MEMO_PACKED)
1582#define LAZY_MEMO_RESET_PACKED(memo) ((memo)->memo_flags &= ~LAZY_MEMO_PACKED)
1592 struct MEMO *result;
1596 return lazy_yielder_result(result,
yielder, procs_array, memos, 0);
1600lazy_yielder_yield(
struct MEMO *result,
long memo_index,
int argc,
const VALUE *
argv)
1611 return lazy_yielder_result(result,
yielder, procs_array, memos, memo_index);
1622 if (!(*entry->
fn->
proc)(
proc, result, memos, i)) {
1634 return result->memo_value;
1664 generator = generator_allocate(rb_cGenerator);
1778 generator = generator_allocate(rb_cGenerator);
1780 enumerator_init(self,
generator, sym_each, 0, 0, 0,
size, 0);
1819 lazy_set_args(lazy,
args);
1831 VALUE new_generator;
1836 &proc_entry_data_type, entry);
1843 lazy_set_args(entry_obj,
memo);
1846 new_generator = lazy_generator_init(obj, new_procs);
1849 new_obj = enumerator_init_copy(enumerator_allocate(rb_cLazy), obj);
1851 new_e->
obj = new_generator;
1852 new_e->
procs = new_procs;
1895enumerable_lazy(
VALUE obj)
1906 return enumerator_init(enumerator_allocate(rb_cLazy),
1936 VALUE lazy, meth = sym_each, super_meth;
1955 return enum_size(self);
1966lazy_eager(
VALUE self)
1969 self, sym_each, 0, 0, lazy_eager_size,
Qnil, 0);
1984 const VALUE *
argv = &result->memo_value;
1987 argc = RARRAY_LENINT(args);
2009 lazy_map_proc, lazy_map_size,
2032 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, &lazy_map_funcs);
2053 const long proc_index = memo_index + 1;
2072 lazy_yielder_yield(
result, proc_index, 1, &
argv);
2084 lazy_flat_map_proc, 0,
2111lazy_flat_map(
VALUE obj)
2117 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, &lazy_flat_map_funcs);
2124 if (!
RTEST(chain))
return 0;
2129 lazy_select_proc, 0,
2141lazy_select(
VALUE obj)
2147 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, &lazy_select_funcs);
2161 lazy_filter_map_proc, 0,
2175lazy_filter_map(
VALUE obj)
2181 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, &lazy_filter_map_funcs);
2188 if (
RTEST(chain))
return 0;
2193 lazy_reject_proc, 0,
2204lazy_reject(
VALUE obj)
2210 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, &lazy_reject_funcs);
2218 if (!
RTEST(chain))
return 0;
2228 if (!
RTEST(chain))
return 0;
2237 lazy_grep_iter_proc, 0,
2256 &lazy_grep_iter_funcs : &lazy_grep_funcs;
2257 return lazy_add_method(obj, 0, 0, pattern,
rb_ary_new3(1, pattern), funcs);
2265 if (
RTEST(chain))
return 0;
2275 if (
RTEST(chain))
return 0;
2284 lazy_grep_v_iter_proc, 0,
2288 lazy_grep_v_proc, 0,
2303 &lazy_grep_v_iter_funcs : &lazy_grep_v_funcs;
2304 return lazy_add_method(obj, 0, 0, pattern,
rb_ary_new3(1, pattern), funcs);
2392 for (i = 0; i <
argc; i++) {
2395 for (; i <
argc; i++) {
2402 funcs = &lazy_zip_funcs[0];
2408 return lazy_add_method(obj, 0, 0, ary, ary, funcs);
2443 lazy_take_proc, lazy_take_size,
2465 argv[0] = sym_cycle;
2485 lazy_take_while_proc, 0,
2496lazy_take_while(
VALUE obj)
2502 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, &lazy_take_while_funcs);
2509 if (
NIL_P(receiver))
2539 lazy_drop_proc, lazy_drop_size,
2561 return lazy_add_method(obj, 2,
argv, n,
rb_ary_new3(1, n), &lazy_drop_funcs);
2576 if (
RTEST(drop))
return 0;
2583 lazy_drop_while_proc, 0,
2594lazy_drop_while(
VALUE obj)
2600 return lazy_add_method(obj, 0, 0,
Qfalse,
Qnil, &lazy_drop_while_funcs);
2604lazy_uniq_check(
VALUE chain,
VALUE memos,
long memo_index)
2619 if (lazy_uniq_check(result->memo_value, memos, memo_index))
return 0;
2628 if (lazy_uniq_check(chain, memos, memo_index))
return 0;
2633 lazy_uniq_iter_proc, 0,
2653 return lazy_add_method(obj, 0, 0,
Qnil,
Qnil, funcs);
2667 argv[0] = result->memo_value;
2687 lazy_with_index_proc, lazy_with_index_size,
2840stop_result(
VALUE self)
2850producer_mark(
void *p)
2858producer_compact(
void *p)
2865#define producer_free RUBY_TYPED_DEFAULT_FREE
2868producer_memsize(
const void *p)
2885producer_ptr(
VALUE obj)
2898producer_allocate(
VALUE klass)
2936producer_each_i(
VALUE obj)
2941 ptr = producer_ptr(obj);
2963producer_each(
VALUE obj)
3038enum_chain_mark(
void *p)
3045enum_chain_compact(
void *p)
3051#define enum_chain_free RUBY_TYPED_DEFAULT_FREE
3054enum_chain_memsize(
const void *p)
3071enum_chain_ptr(
VALUE obj)
3084enum_chain_allocate(
VALUE klass)
3130 ptr0 = enum_chain_ptr(orig);
3174enum_chain_size(
VALUE obj)
3176 return enum_chain_total_size(enum_chain_ptr(obj)->
enums);
3182 return enum_chain_size(obj);
3212 objptr = enum_chain_ptr(obj);
3233enum_chain_rewind(
VALUE obj)
3235 struct enum_chain *objptr = enum_chain_ptr(obj);
3272enum_chain_inspect(
VALUE obj)
3293 return enum_chain_initialize(enum_chain_allocate(rb_cEnumChain),
enums);
3311 return enum_chain_initialize(enum_chain_allocate(rb_cEnumChain),
enums);
3347arith_seq_begin(
VALUE self)
3358arith_seq_end(
VALUE self)
3370arith_seq_step(
VALUE self)
3381arith_seq_exclude_end(
VALUE self)
3387arith_seq_exclude_end_p(
VALUE self)
3389 return RTEST(arith_seq_exclude_end(self));
3396 component->
begin = arith_seq_begin(obj);
3397 component->
end = arith_seq_end(obj);
3398 component->
step = arith_seq_step(obj);
3399 component->
exclude_end = arith_seq_exclude_end_p(obj);
3431 if (
err == 0 && (step < -1 || step > 1)) {
3466 b = arith_seq_begin(self);
3467 e = arith_seq_end(self);
3468 s = arith_seq_step(self);
3496 x = arith_seq_exclude_end_p(self);
3528 while (n > 0 && i < end) {
3530 if (i + unit < i)
break;
3541 while (n > 0 && i > end) {
3543 if (i + unit > i)
break;
3550 else if (RB_FLOAT_TYPE_P(b) || RB_FLOAT_TYPE_P(e) || RB_FLOAT_TYPE_P(s)) {
3571 else if (unit == 0) {
3574 for (i = 0; i <
len; ++i) {
3580 for (i = 0; i < n; ++i) {
3581 double d = i*unit+beg;
3582 if (unit >= 0 ? end < d : d < end) d = end;
3599 else if (RB_FLOAT_TYPE_P(a)) {
3616 else if (RB_FLOAT_TYPE_P(a)) {
3633 else if (RB_FLOAT_TYPE_P(a)) {
3651 else if (RB_FLOAT_TYPE_P(a)) {
3664 else if (RB_FLOAT_TYPE_P(q)) {
3687 int last_is_adjusted;
3690 e = arith_seq_end(self);
3693 "cannot get the last element of endless arithmetic sequence");
3696 b = arith_seq_begin(self);
3697 s = arith_seq_step(self);
3699 len_1 = num_idiv(num_minus(e, b), s);
3700 if (rb_num_negative_int_p(len_1)) {
3707 last = num_plus(b, num_mul(s, len_1));
3708 if ((last_is_adjusted = arith_seq_exclude_end_p(self) &&
rb_equal(
last, e))) {
3716 if (last_is_adjusted) {
3753arith_seq_inspect(
VALUE self)
3823 if (!
rb_equal(arith_seq_begin(self), arith_seq_begin(other))) {
3827 if (!
rb_equal(arith_seq_end(self), arith_seq_end(other))) {
3831 if (!
rb_equal(arith_seq_step(self), arith_seq_step(other))) {
3835 if (arith_seq_exclude_end_p(self) != arith_seq_exclude_end_p(other)) {
3853arith_seq_hash(
VALUE self)
3859 v =
rb_hash(arith_seq_begin(self));
3861 v =
rb_hash(arith_seq_end(self));
3863 v =
rb_hash(arith_seq_step(self));
3870#define NUM_GE(x, y) RTEST(rb_num_coerce_relop((x), (y), idGE))
3885arith_seq_each(
VALUE self)
3892 c = arith_seq_begin(self);
3893 e = arith_seq_end(self);
3894 s = arith_seq_step(self);
3895 x = arith_seq_exclude_end_p(self);
3918 len_1 = num_idiv(num_minus(e, c), s);
3919 last = num_plus(c, num_mul(s, len_1));
3924 if (rb_num_negative_int_p(s)) {
3948arith_seq_size(
VALUE self)
3953 b = arith_seq_begin(self);
3954 e = arith_seq_end(self);
3955 s = arith_seq_step(self);
3956 x = arith_seq_exclude_end_p(self);
3958 if (RB_FLOAT_TYPE_P(b) || RB_FLOAT_TYPE_P(e) || RB_FLOAT_TYPE_P(s)) {
3962 if (rb_num_negative_int_p(s)) {
3992 if (rb_num_negative_int_p(len_1)) {
4007#define sym(name) ID2SYM(rb_intern_const(name))
4011 ID id_private = rb_intern_const(
"private");
4045 rb_define_alias(rb_cLazy,
"_enumerable_collect_concat",
"collect_concat");
4061 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_map"));
4062 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_collect"));
4063 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_flat_map"));
4064 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_collect_concat"));
4065 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_select"));
4066 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_find_all"));
4067 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_filter"));
4068 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_filter_map"));
4069 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_reject"));
4070 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_grep"));
4071 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_grep_v"));
4072 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_zip"));
4073 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_take"));
4074 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_take_while"));
4075 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_drop"));
4076 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_drop_while"));
4077 rb_funcall(rb_cLazy, id_private, 1,
sym(
"_enumerable_uniq"));
4112 rb_hash_aset(lazy_use_super_method,
sym(
"collect_concat"),
sym(
"_enumerable_collect_concat"));
4116 rb_hash_aset(lazy_use_super_method,
sym(
"filter_map"),
sym(
"_enumerable_filter_map"));
4122 rb_hash_aset(lazy_use_super_method,
sym(
"take_while"),
sym(
"_enumerable_take_while"));
4124 rb_hash_aset(lazy_use_super_method,
sym(
"drop_while"),
sym(
"_enumerable_drop_while"));
4126 rb_hash_aset(lazy_use_super_method,
sym(
"with_index"),
sym(
"_enumerable_with_index"));
4148 rb_define_method(rb_cGenerator,
"initialize_copy", generator_init_copy, 1);
4169 rb_define_method(rb_cEnumChain,
"initialize_copy", enum_chain_init_copy, 1);
4200 id_rewind = rb_intern_const(
"rewind");
4201 id_new = rb_intern_const(
"new");
4202 id_next = rb_intern_const(
"next");
4203 id_result = rb_intern_const(
"result");
4204 id_receiver = rb_intern_const(
"receiver");
4205 id_arguments = rb_intern_const(
"arguments");
4206 id_memo = rb_intern_const(
"memo");
4207 id_method = rb_intern_const(
"method");
4208 id_force = rb_intern_const(
"force");
4209 id_to_enum = rb_intern_const(
"to_enum");
4210 id_begin = rb_intern_const(
"begin");
4211 id_end = rb_intern_const(
"end");
4212 id_step = rb_intern_const(
"step");
4213 id_exclude_end = rb_intern_const(
"exclude_end");
4215 sym_cycle =
ID2SYM(rb_intern_const(
"cycle"));
4216 sym_yield =
ID2SYM(rb_intern_const(
"yield"));
VALUE rb_ary_new_from_values(long n, const VALUE *elts)
void rb_ary_store(VALUE ary, long idx, VALUE val)
VALUE rb_ary_dup(VALUE ary)
VALUE rb_ary_push(VALUE ary, VALUE item)
VALUE rb_ary_new_capa(long capa)
VALUE rb_check_array_type(VALUE ary)
VALUE rb_ary_cat(VALUE ary, const VALUE *argv, long len)
VALUE rb_ary_entry(VALUE ary, long offset)
#define RUBY_ASSERT(expr)
Asserts that the given expression is truthy iff RUBY_DEBUG is truthy.
#define UNREACHABLE_RETURN
VALUE rb_big_plus(VALUE x, VALUE y)
VALUE rb_dbl2big(double d)
VALUE rb_fiber_current(void)
VALUE rb_fiber_resume(VALUE fiber_value, int argc, const VALUE *argv)
VALUE rb_fiber_alive_p(VALUE fiber_value)
VALUE rb_fiber_yield(int argc, const VALUE *argv)
VALUE rb_fiber_new(rb_block_call_func_t func, VALUE obj)
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
#define rb_cmpint(cmp, a, b)
VALUE rb_enum_values_pack(int argc, const VALUE *argv)
struct MEMO * lazyenum_proc_func(VALUE, struct MEMO *, VALUE, long)
#define lazy_receiver_size
VALUE rb_arithmetic_sequence_beg_len_step(VALUE obj, long *begp, long *lenp, long *stepp, long len, int err)
VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv, rb_enumerator_size_func *size_fn, VALUE beg, VALUE end, VALUE step, int excl)
#define LAZY_MEMO_PACKED_P(memo)
#define LAZY_MEMO_SET_PACKED(memo)
#define LAZY_MEMO_SET_BREAK(memo)
VALUE rb_enumeratorize(VALUE obj, VALUE meth, int argc, const VALUE *argv)
void Init_Enumerator(void)
#define LAZY_MEMO_RESET_PACKED(memo)
void InitVM_Enumerator(void)
VALUE lazyenum_size_func(VALUE, VALUE)
#define LAZY_MEMO_SET_VALUE(memo, value)
#define LAZY_MEMO_RESET_BREAK(memo)
int rb_arithmetic_sequence_extract(VALUE obj, rb_arithmetic_sequence_components_t *component)
#define LAZY_MEMO_BREAK_P(memo)
char str[HTML_ESCAPE_MAX_LEN+1]
int rb_keyword_given_p(void)
#define RSTRING_LEN(string)
VALUE rb_gc_location(VALUE value)
void rb_gc_mark_movable(VALUE ptr)
void rb_gc_register_mark_object(VALUE obj)
Inform the garbage collector that object is a live Ruby object that should not be moved.
void rb_include_module(VALUE klass, VALUE module)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
ID rb_frame_this_func(void)
The original name of the current method.
void rb_need_block(void)
Declares that the current method needs a block.
void rb_undef_method(VALUE klass, const char *name)
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
int rb_block_given_p(void)
Determines if the current method is given a block.
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_rescue2(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2,...)
An equivalent of rescue clause.
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
void rb_warn(const char *fmt,...)
VALUE rb_mKernel
Kernel module.
VALUE rb_cObject
Object class.
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
VALUE rb_obj_class(VALUE)
VALUE rb_obj_dup(VALUE)
Equivalent to Object#dup in Ruby.
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
VALUE rb_equal(VALUE, VALUE)
This function is an optimized version of calling #==.
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
VALUE rb_obj_freeze(VALUE)
Make the object unmodifiable.
VALUE rb_to_int(VALUE)
Converts val into Integer.
int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val)
void rb_hash_foreach(VALUE hash, rb_foreach_func *func, VALUE farg)
VALUE rb_hash_new_with_size(st_index_t size)
VALUE rb_hash_aref(VALUE hash, VALUE key)
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
IMEMO: Internal memo object.
#define MEMO_NEW(a, b, c)
Thin wrapper to ruby/config.h.
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_funcall_with_block(VALUE, ID, int, const VALUE *, VALUE)
VALUE rb_call_super(int, const VALUE *)
#define rb_enumeratorize_with_size(obj, id, argc, argv, size_fn)
VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE)
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn)
#define rb_enumeratorize_with_size_kw(obj, id, argc, argv, size_fn, kw_splat)
void rb_provide(const char *)
VALUE rb_num_coerce_cmp(VALUE, VALUE, ID)
#define OBJ_INIT_COPY(obj, orig)
VALUE rb_obj_method(VALUE, VALUE)
VALUE rb_obj_is_proc(VALUE)
VALUE rb_proc_call_with_block(VALUE, int argc, const VALUE *argv, VALUE)
VALUE rb_block_proc(void)
VALUE rb_proc_call_kw(VALUE, VALUE, int)
int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
#define rb_hash_uint(h, i)
st_index_t rb_hash_start(st_index_t)
void rb_str_set_len(VALUE, long)
VALUE rb_str_append(VALUE, VALUE)
VALUE rb_str_buf_append(VALUE, VALUE)
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
VALUE rb_ivar_get(VALUE, ID)
VALUE rb_class_path(VALUE)
VALUE rb_attr_get(VALUE, ID)
VALUE rb_ivar_set(VALUE, ID, VALUE)
VALUE rb_check_funcall_kw(VALUE, ID, int, const VALUE *, int)
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
int rb_respond_to(VALUE, ID)
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
void rb_undef_alloc_func(VALUE)
ID rb_intern(const char *)
Internal header for Enumerator.
Internal header for Hash.
Internal header for Numeric.
VALUE rb_float_floor(VALUE x, int ndigits)
VALUE rb_float_mul(VALUE x, VALUE y)
VALUE rb_float_plus(VALUE x, VALUE y)
double ruby_float_step_size(double beg, double end, double unit, int excl)
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless)
VALUE rb_float_div(VALUE x, VALUE y)
VALUE rb_int_minus(VALUE x, VALUE y)
VALUE rb_int_idiv(VALUE x, VALUE y)
VALUE rb_float_minus(VALUE x, VALUE y)
VALUE rb_int_plus(VALUE x, VALUE y)
VALUE rb_int_gt(VALUE x, VALUE y)
VALUE rb_int_succ(VALUE num)
VALUE rb_int_mul(VALUE x, VALUE y)
Internal header for Range.
VALUE rb_range_component_beg_len(VALUE b, VALUE e, int excl, long *begp, long *lenp, long len, int err)
Internal header for Rational.
VALUE rb_rational_plus(VALUE self, VALUE other)
VALUE rb_rational_floor(VALUE self, int ndigits)
VALUE rb_rational_div(VALUE self, VALUE other)
VALUE rb_rational_minus(VALUE self, VALUE other)
VALUE rb_rational_mul(VALUE self, VALUE other)
#define rb_ary_new_from_args(...)
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)
VALUE rb_block_call_kw(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE, int)
VALUE rb_yield_values(int n,...)
VALUE rb_yield_values2(int n, const VALUE *argv)
VALUE rb_yield_values_kw(int n, const VALUE *argv, int kw_splat)
VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
#define MEMCPY(p1, p2, type, n)
VALUE rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
Call a method with a block.
VALUE rb_proc_new(type *q, VALUE w)
Creates a rb_cProc instance.
#define RARRAY_CONST_PTR(s)
#define RARRAY_AREF(a, i)
#define TypedData_Get_Struct(obj, type, data_type, sval)
@ RUBY_TYPED_FREE_IMMEDIATELY
#define TypedData_Make_Struct(klass, type, data_type, sval)
#define RB_INTEGER_TYPE_P(obj)
#define RB_PASS_CALLED_KEYWORDS
VALUE rb_str_catf(VALUE, const char *,...)
VALUE rb_sprintf(const char *,...)
rb_enumerator_size_func * size_fn
lazyenum_size_func * size
lazyenum_proc_func * proc
const lazyenum_funcs * fn