blob: 793181d1489e9c782d66f505e9d45901ca2cd4d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "ruby.h"
#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
VALUE
bug_str_modify(VALUE str)
{
rb_str_modify(str);
return str;
}
void
Init_string(void)
{
VALUE mBug = rb_define_module("Bug");
VALUE klass = rb_define_class_under(mBug, "String", rb_cString);
rb_define_method(klass, "modify!", bug_str_modify, 0);
TEST_INIT_FUNCS(init);
}
|