Kouhei Sutou
kous****@users*****
2006年 11月 27日 (月) 13:20:18 JST
Index: tomoe/ext/ruby/tomoe-rb-dict.c diff -u tomoe/ext/ruby/tomoe-rb-dict.c:1.2 tomoe/ext/ruby/tomoe-rb-dict.c:1.3 --- tomoe/ext/ruby/tomoe-rb-dict.c:1.2 Sun Nov 26 16:30:37 2006 +++ tomoe/ext/ruby/tomoe-rb-dict.c Mon Nov 27 13:20:17 2006 @@ -11,6 +11,12 @@ } static VALUE +td_get_char(VALUE self, VALUE code_point) +{ + return GOBJ2RVAL(tomoe_dict_get_char(_SELF(self), RVAL2CSTR(code_point))); +} + +static VALUE td_save(VALUE self) { tomoe_dict_save(_SELF(self)); @@ -27,5 +33,7 @@ rb_define_method(cTomoeDict, "initialize", td_initialize, 2); + rb_define_method(cTomoeDict, "[]", td_get_char, 1); + rb_define_method(cTomoeDict, "save", td_save, 0); }