OSDN Git Service

$stdout.flush and $stderr.flush are implemented; nothing to do, but required by Kerne...
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Sun, 16 Feb 2014 14:50:59 +0000 (14:50 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Sun, 16 Feb 2014 14:50:59 +0000 (14:50 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@438 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/Ruby_bind/ruby_bind.c

index f281ace..ee73099 100644 (file)
@@ -386,6 +386,19 @@ s_StandardErrorOutput(VALUE self, VALUE str)
 
 /*
  *  call-seq:
+ *     stdout.flush
+ *     stderr.flush
+ *
+ *  Flush the standard (error) output. Actually do nothing.
+ */
+static VALUE
+s_FlushConsoleOutput(VALUE self)
+{
+       return self;
+}
+
+/*
+ *  call-seq:
  *     stdin.gets(rs = $/)
  *
  *  Read one line message via dialog box.
@@ -11117,9 +11130,11 @@ Molby_startup(const char *script, const char *dir)
        /*  Create objects for stdout and stderr  */
        val = rb_funcall(rb_cObject, rb_intern("new"), 0);
        rb_define_singleton_method(val, "write", s_StandardOutput, 1);
+       rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0);
        rb_gv_set("$stdout", val);
        val = rb_funcall(rb_cObject, rb_intern("new"), 0);
        rb_define_singleton_method(val, "write", s_StandardErrorOutput, 1);
+       rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0);
        rb_gv_set("$stderr", val);
 
        /*  Create objects for stdin  */