146 #define enumerator_free RUBY_TYPED_DEFAULT_FREE
787 int tainted, untrusted;
794 return rb_sprintf(
"#<%s: uninitialized>", cname);
861 #define yielder_free RUBY_TYPED_DEFAULT_FREE
866 return p ?
sizeof(
struct yielder) : 0;
966 #define generator_free RUBY_TYPED_DEFAULT_FREE
1039 "wrong argument type %s (expected Proc)",
1043 rb_warn(
"given block not used");
static void enumerator_mark(void *p)
VALUE rb_ary_new4(long n, const VALUE *elts)
static VALUE next_i(VALUE curr, VALUE obj)
static VALUE rb_cGenerator
static VALUE enumerator_rewind(VALUE obj)
VALUE rb_yield_values(int n,...)
static void generator_mark(void *p)
static VALUE enumerator_peek_values(VALUE obj)
static VALUE yielder_new(void)
static VALUE generator_init_copy(VALUE obj, VALUE orig)
static size_t generator_memsize(const void *p)
SSL_METHOD *(* func)(void)
static VALUE yielder_allocate(VALUE klass)
static VALUE enumerator_each(VALUE obj)
#define rb_block_call(arg1, arg2, arg3, arg4, arg5, arg6)
#define TypedData_Get_Struct(obj, type, data_type, sval)
static VALUE yielder_init(VALUE obj, VALUE proc)
static VALUE enumerator_with_object_i(VALUE val, VALUE memo, int argc, VALUE *argv)
VALUE rb_str_concat(VALUE, VALUE)
VALUE rb_fiber_yield(int argc, VALUE *argv)
static const rb_data_type_t generator_data_type
static VALUE enumerator_next_values(VALUE obj)
VALUE rb_fiber_alive_p(VALUE fibval)
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_fiber_current(void)
static const rb_data_type_t yielder_data_type
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
#define RARRAY_LEN(ARRAY)
VALUE rb_ary_new3(long n,...)
static VALUE enumerator_next(VALUE obj)
void rb_include_module(VALUE klass, VALUE module)
static VALUE enumerator_block_call(VALUE obj, rb_block_call_func *func, VALUE arg)
static VALUE yielder_yield(VALUE obj, VALUE args)
static VALUE generator_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE generator_allocate(VALUE klass)
static VALUE yielder_yield_i(VALUE obj, VALUE memo, int argc, VALUE *argv)
const char * rb_obj_classname(VALUE)
static VALUE enumerator_with_object(VALUE obj, VALUE memo)
static VALUE generator_each(VALUE obj)
VALUE rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
void rb_exc_raise(VALUE mesg)
static struct enumerator * enumerator_ptr(VALUE obj)
static VALUE get_next_values(VALUE obj, struct enumerator *e)
VALUE rb_fiber_resume(VALUE fibval, int argc, VALUE *argv)
static VALUE enumerator_with_index(int argc, VALUE *argv, VALUE obj)
int rb_block_given_p(void)
static VALUE obj_to_enum(int argc, VALUE *argv, VALUE obj)
RUBY_EXTERN VALUE rb_cObject
VALUE rb_str_buf_cat2(VALUE, const char *)
RUBY_EXTERN VALUE rb_mKernel
static VALUE enumerator_peek_values_m(VALUE obj)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
static void next_init(VALUE obj, struct enumerator *e)
VALUE rb_fiber_new(VALUE(*func)(ANYARGS), VALUE obj)
static VALUE stop_result(VALUE self)
static VALUE enumerator_with_index_i(VALUE val, VALUE m, int argc, VALUE *argv)
static VALUE generator_init(VALUE obj, VALUE proc)
static VALUE yielder_yield_push(VALUE obj, VALUE args)
VALUE rb_obj_is_proc(VALUE)
VALUE rb_check_funcall(VALUE, ID, int, VALUE *)
VALUE rb_sprintf(const char *format,...)
static VALUE enumerator_each_with_index(VALUE obj)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
VALUE rb_exc_new2(VALUE etype, const char *s)
static size_t enumerator_memsize(const void *p)
VALUE rb_int_succ(VALUE num)
VALUE rb_proc_call(VALUE, VALUE)
static VALUE enumerator_initialize(int argc, VALUE *argv, VALUE obj)
VALUE rb_block_call_func(VALUE, VALUE, int, VALUE *)
#define RARRAY_LENINT(ary)
#define NEW_MEMO(a, b, c)
VALUE rb_yield_values2(int n, const VALUE *argv)
static VALUE inspect_enumerator(VALUE obj, VALUE dummy, int recur)
static struct generator * generator_ptr(VALUE obj)
VALUE rb_block_proc(void)
static void yielder_mark(void *p)
rb_ivar_set(einfo, ID_at_interp, interp)
VALUE rb_proc_new(VALUE(*)(ANYARGS), VALUE)
void Init_Enumerator(void)
static VALUE next_ii(VALUE i, VALUE obj, int argc, VALUE *argv)
#define TypedData_Make_Struct(klass, type, data_type, sval)
VALUE rb_ary_dup(VALUE ary)
static VALUE enumerator_allocate(VALUE klass)
static VALUE enumerator_init_copy(VALUE obj, VALUE orig)
#define RETURN_ENUMERATOR(obj, argc, argv)
static const rb_data_type_t enumerator_data_type
static VALUE enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
static VALUE yielder_initialize(VALUE obj)
const char * rb_id2name(ID id)
static VALUE ary2sv(VALUE args, int dup)
static VALUE enumerator_peek(VALUE obj)
static size_t yielder_memsize(const void *p)
static VALUE enumerator_inspect(VALUE obj)
static VALUE enumerator_feed(VALUE obj, VALUE v)
static struct yielder * yielder_ptr(VALUE obj)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void rb_provide(const char *)
void rb_warn(const char *fmt,...)
VALUE rb_attr_get(VALUE, ID)