Change soft-fail to use the config, rather than env
[rbx.git] / spec / subtend / ext / subtend_struct_define.c
blobdc7fd041cbf8e7c0d514386533bdc22fafecc667
1 #include <ruby.h>
2 #include <intern.h>
4 /* Only allow setting three attributes, should be sufficient for testing. */
5 static VALUE sa_struct_define(VALUE self, VALUE name,
6 VALUE attr1, VALUE attr2, VALUE attr3) {
8 const char *a1 = StringValuePtr(attr1);
9 const char *a2 = StringValuePtr(attr2);
10 const char *a3 = StringValuePtr(attr3);
11 char *nm = NULL;
13 if (name != Qnil) nm = StringValuePtr(name);
15 return rb_struct_define(nm, a1, a2, a3, NULL);
18 void Init_subtend_struct_define() {
19 VALUE cls;
20 cls = rb_define_class("SubtendStructDefine", rb_cObject);
21 rb_define_method(cls, "rb_struct_define", sa_struct_define, 4);