Change soft-fail to use the config, rather than env
[rbx.git] / spec / subtend / ext / subtend_proc.c
blobe766538efcf035a0e01c2b5a78350add7b8d4301
1 #include <ruby.h>
2 #include <string.h>
4 VALUE concat_func(VALUE args) {
5 int i;
6 char buffer[500] = {0};
7 for(i = 0; i < RARRAY(args)->len; ++i) {
8 VALUE v = RARRAY(args)->ptr[i];
9 strcat(buffer, STR2CSTR(v));
10 strcat(buffer, "_");
12 buffer[strlen(buffer) - 1] = 0;
13 return rb_str_new2(buffer);
17 VALUE sp_underline_concat_proc(VALUE self) {
18 return rb_proc_new(concat_func, Qnil);
21 void Init_subtend_proc() {
22 VALUE cls;
23 cls = rb_define_class("SubtendProc", rb_cObject);
25 rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0);