Change soft-fail to use the config, rather than env
[rbx.git] / spec / subtend / ext / subtend_hash.c
blobd38e5ff2df694a9d57419a2174c1a43787ab7d61
1 #include <ruby.h>
3 VALUE sh_new_hash(VALUE self) {
4 return rb_hash_new();
7 VALUE sh_access(VALUE self, VALUE hash, VALUE key) {
8 return rb_hash_aref(hash, key);
11 VALUE sh_insert(VALUE self, VALUE hash, VALUE key, VALUE val) {
12 return rb_hash_aset(hash, key, val);
15 VALUE sh_remove(VALUE self, VALUE hash, VALUE key) {
16 return rb_hash_delete(hash, key);
19 void Init_subtend_hash() {
20 VALUE cls;
21 cls = rb_define_class("SubtendHash", rb_cObject);
22 rb_define_method(cls, "new_hash", sh_new_hash, 0);
23 rb_define_method(cls, "access", sh_access, 2);
24 rb_define_method(cls, "insert", sh_insert, 3);
25 rb_define_method(cls, "remove", sh_remove, 2);