[Tomoe-cvs 1139] CVS update: tomoe/ext/ruby

Back to archive index

Kouhei Sutou kous****@users*****
2006年 11月 27日 (月) 15:54:25 JST


Index: tomoe/ext/ruby/tomoe-rb-char.c
diff -u tomoe/ext/ruby/tomoe-rb-char.c:1.4 tomoe/ext/ruby/tomoe-rb-char.c:1.5
--- tomoe/ext/ruby/tomoe-rb-char.c:1.4	Mon Nov 27 15:46:41 2006
+++ tomoe/ext/ruby/tomoe-rb-char.c	Mon Nov 27 15:54:25 2006
@@ -16,6 +16,19 @@
 }
 
 static VALUE
+tc_get_n_strokes(VALUE self)
+{
+    return INT2NUM(tomoe_char_get_n_strokes(_SELF(self)));
+}
+
+static VALUE
+tc_set_n_strokes(VALUE self, VALUE n_strokes)
+{
+    tomoe_char_set_n_strokes(_SELF(self), NUM2INT(n_strokes));
+    return Qnil;
+}
+
+static VALUE
 tc_get_writing(VALUE self)
 {
     return GOBJ2RVAL(tomoe_char_get_writing(_SELF(self)));
@@ -47,7 +60,10 @@
 
     rb_define_method(cTomoeChar, "code", tc_get_code, 0);
     rb_define_method(cTomoeChar, "code=", tc_set_code, 1);
+    rb_define_method(cTomoeChar, "n_strokes", tc_get_n_strokes, 0);
+    rb_define_method(cTomoeChar, "n_strokes=", tc_set_n_strokes, 1);
     rb_define_method(cTomoeChar, "writing", tc_get_writing, 0);
+
     rb_define_method(cTomoeChar, "to_xml", tc_to_xml, 0);
 }
 


tomoe-cvs メーリングリストの案内
Back to archive index