summaryrefslogtreecommitdiff
path: root/ext/-test-/string
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-07 06:40:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-07 06:40:33 +0000
commitf4ca906d5c3267c0f84db4c5780829783c71a8b6 (patch)
treee128cf5e2968e6f9583ae4b23734ed64bcd15d56 /ext/-test-/string
parent136c117fc1c5e396f71d2db0a192fb195bb5f37e (diff)
* ext/-test-/string/modify.c: split from init.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/string')
-rw-r--r--ext/-test-/string/init.c8
-rw-r--r--ext/-test-/string/modify.c14
2 files changed, 14 insertions, 8 deletions
diff --git a/ext/-test-/string/init.c b/ext/-test-/string/init.c
index 793181d..0b3e4a6 100644
--- a/ext/-test-/string/init.c
+++ b/ext/-test-/string/init.c
@@ -2,18 +2,10 @@
#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);
}
diff --git a/ext/-test-/string/modify.c b/ext/-test-/string/modify.c
new file mode 100644
index 0000000..a693005
--- /dev/null
+++ b/ext/-test-/string/modify.c
@@ -0,0 +1,14 @@
+#include "ruby.h"
+
+VALUE
+bug_str_modify(VALUE str)
+{
+ rb_str_modify(str);
+ return str;
+}
+
+void
+Init_modify(VALUE klass)
+{
+ rb_define_method(klass, "modify!", bug_str_modify, 0);
+}