2012-01-24 09:20:48 +04:00
|
|
|
#include <ruby.h>
|
|
|
|
|
2013-02-21 12:31:47 +04:00
|
|
|
static VALUE
|
|
|
|
iter_break(VALUE self)
|
|
|
|
{
|
|
|
|
rb_iter_break();
|
|
|
|
|
2018-07-24 08:38:07 +03:00
|
|
|
UNREACHABLE_RETURN(Qnil);
|
2013-02-21 12:31:47 +04:00
|
|
|
}
|
|
|
|
|
2012-01-24 09:20:48 +04:00
|
|
|
static VALUE
|
|
|
|
iter_break_value(VALUE self, VALUE val)
|
|
|
|
{
|
|
|
|
rb_iter_break_value(val);
|
2012-04-14 04:36:26 +04:00
|
|
|
|
2018-07-24 08:38:07 +03:00
|
|
|
UNREACHABLE_RETURN(Qnil);
|
2012-01-24 09:20:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-11-30 08:21:26 +04:00
|
|
|
Init_break(VALUE klass)
|
2012-01-24 09:20:48 +04:00
|
|
|
{
|
2013-11-30 08:21:26 +04:00
|
|
|
VALUE breakable = rb_define_module_under(klass, "Breakable");
|
2013-02-21 12:31:47 +04:00
|
|
|
rb_define_module_function(breakable, "iter_break", iter_break, 0);
|
|
|
|
rb_define_module_function(breakable, "iter_break_value", iter_break_value, 1);
|
2012-01-24 09:20:48 +04:00
|
|
|
}
|