2012-01-24 00:20:48 -05:00
|
|
|
#include <ruby.h>
|
|
|
|
|
2013-02-21 03:31:47 -05:00
|
|
|
static VALUE
|
|
|
|
iter_break(VALUE self)
|
|
|
|
{
|
|
|
|
rb_iter_break();
|
|
|
|
|
2018-07-24 01:38:07 -04:00
|
|
|
UNREACHABLE_RETURN(Qnil);
|
2013-02-21 03:31:47 -05:00
|
|
|
}
|
|
|
|
|
2012-01-24 00:20:48 -05:00
|
|
|
static VALUE
|
|
|
|
iter_break_value(VALUE self, VALUE val)
|
|
|
|
{
|
|
|
|
rb_iter_break_value(val);
|
2012-04-13 20:36:26 -04:00
|
|
|
|
2018-07-24 01:38:07 -04:00
|
|
|
UNREACHABLE_RETURN(Qnil);
|
2012-01-24 00:20:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-11-29 23:21:26 -05:00
|
|
|
Init_break(VALUE klass)
|
2012-01-24 00:20:48 -05:00
|
|
|
{
|
2013-11-29 23:21:26 -05:00
|
|
|
VALUE breakable = rb_define_module_under(klass, "Breakable");
|
2013-02-21 03:31:47 -05: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 00:20:48 -05:00
|
|
|
}
|