[#9811] Ruby book — WATANABE Tetsuya <tetsu@...>

今日のひとこと(10/05)

22 messages 1998/10/05
[#9812] Re: Ruby book — matz@... (Yukihiro Matsumoto) 1998/10/05

まつもと ゆきひろです

[#9813] Re: Ruby book — "D.Kanda" <MAP2303@...> 1998/10/05

[#9815] Re: Ruby book — matz@... (Yukihiro Matsumoto) 1998/10/05

まつもと ゆきひろです

[#9827] Are there any NNTP Client Class? — Takeshi UME Imai <takeshi@...>

はじめまして。今井といいます。

17 messages 1998/10/05
[#9828] Re: Are there any NNTP Client Class? — aamine@... 1998/10/05

はじめまして、あおきともうします。

[#9869] man-1.1/Marshal.html — ttate@...

立石です。

47 messages 1998/10/07
[#9872] Re: man-1.1/Marshal.html — matz@... (Yukihiro Matsumoto) 1998/10/08

まつもと ゆきひろです

[#9880] comments on manual (Re: man-1.1/Marshal.html) — Motoyuki Kasahara <m-kasahr@...> 1998/10/08

SRA の笠原です。

[#9881] Re: comments on manual (Re: man-1.1/Marshal.html) — matz@... (Yukihiro Matsumoto) 1998/10/08

まつもと ゆきひろです

[#9909] Re: comments on manual (Re: man-1.1/Marshal.html) — Motoyuki Kasahara <m-kasahr@...> 1998/10/09

SRA の笠原です。

[#9936] Re: comments on manual (Re: man-1.1/Marshal.html) — matz@... (Yukihiro Matsumoto) 1998/10/09

まつもと ゆきひろです

[#9939] Re: comments on manual (Re: man-1.1/Marshal.html) — Shin-ichro Hara <sinara@...> 1998/10/09

原です。

[#9940] Re: comments on manual (Re: man-1.1/Marshal.html) — matz@... (Yukihiro Matsumoto) 1998/10/09

まつもと ゆきひろです

[#9941] Re: comments on manual (Re: man-1.1/Marshal.html) — Shin-ichro Hara <sinara@...> 1998/10/09

原です。

[#9942] Re: comments on manual (Re: man-1.1/Marshal.html) — matz@... (Yukihiro Matsumoto) 1998/10/09

まつもと ゆきひろです

[#9944] read(nil) (Re: comments on manual) — Shin-ichro Hara <sinara@...> 1998/10/09

原です。

[#9884] List of UserInterface Kits for Ruby ? — a.furudo@...

20 messages 1998/10/08
[#9906] Re: List of UserInterface Kits for Ruby ? — matz@... (Yukihiro Matsumoto) 1998/10/09

まつもと ゆきひろです

[#9885] 文字化け失礼、再送 — Akihiro Furudo <a.furudo@...>

26 messages 1998/10/08
[#9888] Re: 文字化け失礼、再送 — ttate@... 1998/10/08

立石です。

[#9897] お礼と、 Ruby/Gtk(i18n) について質問 — Akihiro Furudo <A.Furudo@...> 1998/10/08

[#9982] Re: お礼と、 Ruby/Gtk(i18n) について質問 — Daisuke Kanda <MAP2303@...> 1998/10/11

[#10320] Ruby/Gtk を FreeBSD にインストール (re:9982) — Akihiro Furudo <a.furudo@...> 1998/10/24

[#10328] Re: Ruby/Gtk を FreeBSD にインストール (re:9982) — Daisuke Kanda <MAP2303@...> 1998/10/25

[#9976] ruby:struct -> ext module -> ruby — Kikutani Makoto <kikutani@...>

きくたにです。

17 messages 1998/10/11

[#9999] ruby on HP-UX — AU6M-IWM@... (Iwama Misao)

20 messages 1998/10/12
[#10001] Re: ruby on HP-UX — matz@... (Yukihiro Matsumoto) 1998/10/12

まつもと ゆきひろです

[#10030] Ruby/Gtk text widget — TAKAHASHI Masayoshi <maki@...>

高橋です。

29 messages 1998/10/12
[#10035] Re: Ruby/Gtk text widget — Daisuke Kanda <MAP2303@...> 1998/10/12

[#10038] ruby/gtk method naming (Re: Re: Ruby/Gtk text widget) — "D.Kanda" <MAP2303@...> 1998/10/13

[#10067] Re: ruby/gtk method naming (Re: Re: Ruby/Gtk text widget) — Kazumi Okamoto <kazusan@...> 1998/10/13

岡本です。

[#10092] for が修飾子だったら — ARIMA Yasuhiro <fit0298@...>

有馬@FITECです。

46 messages 1998/10/14
[#10093] Re: for が修飾子だったら — matz@... (Yukihiro Matsumoto) 1998/10/14

まつもと ゆきひろです

[#10236] Array.html again — Motoyuki Kasahara <m-kasahr@...>

笠原です。こんにちは。

18 messages 1998/10/22
[#10237] Re: Array.html again — Kanda <MAP2303@...> 1998/10/22

[#10239] Re: Array.html again — matz@... (Yukihiro Matsumoto) 1998/10/22

まつもと ゆきひろです

[#10311] Re: 大規模プログラムの友 — m_seki@... (SEKI)

At 11:23 PM 98.10.23 +0900, Takashi Nakai wrote:

24 messages 1998/10/23
[#10312] Re: 大規模プログラムの友 — Takashi Nakai <nakai@...1.sys.to.casio.co.jp> 1998/10/23

ど〜も、(またしても)中井です。

[#10369] Re: 大規模プログラムの友 — matz@... (Yukihiro Matsumoto) 1998/10/27

まつもと ゆきひろです

[#10415] split — flare@... (Takashi Ikeda)

ふれあです。

20 messages 1998/10/28

[#10473] case with Class — MineroAoki <aamine@...>

あおきです。

46 messages 1998/10/29
[#10483] Re: case with Class — matz@... (Yukihiro Matsumoto) 1998/10/30

まつもと ゆきひろです

[#10521] Re: case with Class — aamine@... 1998/10/30

こんにちは。あおきです。

[#10523] Re: case with Class — gotoken@... (GOTO Kentaro) 1998/10/30

ごとけんです

[#10530] Re: case with Class — aamine@... 1998/10/31

あおきです。

[#10544] Re: case with Class — shugo@... (MAEDA Shugo) 1998/10/31

前田です。

[#10548] Re: case with Class — Wakou Aoyama <wakou@...> 1998/10/31

青山です。

[#10555] Re: case with Class — shugo@... (MAEDA Shugo) 1998/11/01

前田です。

[#10566] Re: case with Class — Wakou Aoyama <wakou@...> 1998/11/01

青山です。

[ruby-list:10268] terminfo

From: aito@...
Date: 1998-10-22 19:44:05 UTC
List: ruby-list #10268
あ伊藤です.

先日 curses で変なことを口走ったから,というわけでもないの
ですが,curses 拡張モジュールに,低レベルの terminfo ライブ
ラリへのインタフェースを追加してみました.

もし可能なら,curses の配布パッケージに追加していただきたい
のですが.標準配布するのがいかん,という場合は,別な拡張
モジュールにする予定です.

# pty と terminfo.さあ次は何だ?
--
aito

*** curses.c.org	Wed Oct 21 12:19:58 1998
--- curses.c	Wed Oct 21 14:27:30 1998
***************
*** 28,36 ****
--- 28,38 ----
  #endif
  
  #include "ruby.h"
+ #include "rubyio.h"    /* by A. Ito */
  
  static VALUE mCurses;
  static VALUE cWindow;
+ static VALUE mTerminfo;  /* by A. Ito */
  
  VALUE rb_stdscr;
  
***************
*** 750,755 ****
--- 752,917 ----
      return Qnil;
  }
  
+ /*------------------------- module Terminfo-------------------------*/
+ /* terminfo module is added by A. Ito, 21 October, 1998             */
+ 
+ #include <term.h>
+ 
+ /* def setupterm(term,file) */
+ static VALUE
+ ti_setupterm(obj,term,file)
+ VALUE obj;
+ VALUE file;
+ VALUE term;
+ {
+     int err_return;
+     char *c_term;
+     if (NIL_P(term))
+         c_term = NULL;
+     else {
+ 	Check_Type(term,T_STRING);
+         c_term = RSTRING(term)->ptr;
+     }
+     Check_Type(file,T_FILE);
+     setupterm(c_term,fileno(RFILE(file)->fptr->f),&err_return);
+     if (err_return == 0)
+         Fail("Can't find terminal %s",c_term?c_term:"(NULL)");
+     else if (err_return == -1)
+         Fail("Can't find terminfo database");
+ 
+     return Qnil;
+ }
+ 
+ /* def def_prog_mode */
+ static VALUE
+ ti_def_prog_mode(obj)
+ VALUE obj;
+ {
+     def_prog_mode();
+     return Qnil;
+ }
+ 
+ /* def def_shell_mode */
+ static VALUE
+ ti_def_shell_mode(obj)
+ VALUE obj;
+ {
+     def_shell_mode();
+     return Qnil;
+ }
+ 
+ /* def reset_prog_mode */
+ static VALUE
+ ti_reset_prog_mode(obj)
+ VALUE obj;
+ {
+     reset_prog_mode();
+     return Qnil;
+ }
+ 
+ /* def reset_shell_mode */
+ static VALUE
+ ti_reset_shell_mode(obj)
+ VALUE obj;
+ {
+     reset_shell_mode();
+     return Qnil;
+ }
+ 
+ /* def tigetstr(capname) */
+ static VALUE
+ ti_tigetstr(obj,capname)
+ VALUE obj;
+ VALUE capname;
+ {
+     char* ret;
+     Check_Type(capname,T_STRING);
+     ret = tigetstr(RSTRING(capname)->ptr);
+     if (ret == (char*)-1)
+         Fail("unknown terminfo string entry :%s",RSTRING(capname)->ptr);
+     if (ret == NULL)
+        return Qnil;
+     return str_new2(ret);
+ }
+ 
+ /* def tigetnum(capname) */
+ static VALUE
+ ti_tigetnum(obj,capname)
+ VALUE obj;
+ VALUE capname;
+ {
+     int ret;
+     Check_Type(capname,T_STRING);
+     ret = tigetnum(RSTRING(capname)->ptr);
+     if (ret == -2)
+         Fail("unknown terminfo number entry: %s",RSTRING(capname)->ptr);
+     return INT2FIX(ret);
+ }
+ 
+ /* def tigetflag(capname) */
+ static VALUE
+ ti_tigetflag(obj,capname)
+ VALUE obj;
+ VALUE capname;
+ {
+     int ret;
+     Check_Type(capname,T_STRING);
+     ret = tigetflag(RSTRING(capname)->ptr);
+     if (ret == -1)
+         Fail("unknown terminfo boolean entry: %s",RSTRING(capname)->ptr);
+     return ret==0?FALSE:TRUE;
+ }
+ 
+ /* def tparm(str,...) */
+ static VALUE
+ ti_tparm(argc,argv,obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+ {
+     long int p[9];
+     char *str;
+     int i;
+ 
+     if (argc < 1)
+       Fail("too few argument");
+     if (argc >= 10)
+       Fail("too many argument");
+     for (i = 0; i < 9; i++)
+         p[i] = 0;
+     Check_Type(argv[0],T_STRING);
+     str = RSTRING(argv[0])->ptr;
+     for (i = 1; i < argc; i++) {
+         Check_Type(argv[i],T_FIXNUM);
+         p[i-1] = FIX2INT(argv[i]);
+     }
+     return str_new2(tparm(str,p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9]));
+ }
+ 
+ static FILE *output_stream_for_putc;
+ 
+ static int
+ ti_pseudo_putc(char c)
+ {
+     fputc(c,output_stream_for_putc);
+     return c;
+ }
+ 
+ /* def tputs(str,io) */
+ static VALUE
+ ti_tputs(obj,str,io)
+ VALUE obj;
+ VALUE str;
+ VALUE io;
+ {
+     Check_Type(str,T_STRING);
+     Check_Type(io,T_FILE);
+     output_stream_for_putc = RFILE(io)->fptr->f;
+     tputs(RSTRING(str)->ptr,1,ti_pseudo_putc);
+     return Qnil;
+ }
+ 
+ 
  /*------------------------- Initialization -------------------------*/
  void
  Init_curses()
***************
*** 817,820 ****
--- 979,994 ----
      rb_define_method(cWindow, "deleteln", window_deleteln, 0);
  
      rb_set_end_proc(curses_finalize, 0);
+ 
+     mTerminfo = rb_define_module("Terminfo");
+     rb_define_module_function(mTerminfo, "setupterm", ti_setupterm, 2);
+     rb_define_module_function(mTerminfo, "def_prog_mode", ti_def_prog_mode, 0);
+     rb_define_module_function(mTerminfo, "def_shell_mode", ti_def_shell_mode, 0);
+     rb_define_module_function(mTerminfo, "reset_prog_mode", ti_reset_prog_mode, 0);
+     rb_define_module_function(mTerminfo, "reset_shell_mode", ti_reset_shell_mode, 0);
+     rb_define_module_function(mTerminfo, "getstr", ti_tigetstr, 1);
+     rb_define_module_function(mTerminfo, "getnum", ti_tigetnum, 1);
+     rb_define_module_function(mTerminfo, "getflag", ti_tigetflag, 1);
+     rb_define_module_function(mTerminfo, "tparm", ti_tparm, -1);
+     rb_define_module_function(mTerminfo, "tputs", ti_tputs, 2);
  }

In This Thread