From 29b7d942bfe9a92b5c3124e235fa54b5de31dccf Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 13 Aug 1999 05:37:52 +0000 Subject: remove marshal/gtk/kconv git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/curses/curses.c | 24 ++++++++++++++++++++++-- ext/curses/extconf.rb | 15 +++++++-------- 2 files changed, 29 insertions(+), 10 deletions(-) (limited to 'ext/curses') diff --git a/ext/curses/curses.c b/ext/curses/curses.c index f3d1bc097..202a0f924 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -10,6 +10,10 @@ #else # ifdef HAVE_NCURSES_CURSES_H # include +#else +# ifdef HAVE_CURSES_COLR_CURSES_H +# include +# include # else # include # if (defined(__bsdi__) || defined(__NetBSD__)) && !defined(_maxx) @@ -26,8 +30,11 @@ # endif # endif #endif +#endif +#include "stdio.h" #include "ruby.h" +#include "rubyio.h" static VALUE mCurses; static VALUE cWindow; @@ -350,6 +357,7 @@ static VALUE curses_getch(obj) VALUE obj; { + rb_read_check(stdin); return CHR2FIX(getch()); } @@ -359,6 +367,8 @@ curses_getstr(obj) VALUE obj; { char rtn[1024]; /* This should be big enough.. I hope */ + + rb_read_check(stdin); getstr(rtn); return rb_tainted_str_new2(rtn); } @@ -408,11 +418,13 @@ window_s_new(class, lines, cols, top, left) { VALUE w; WINDOW *window; + VALUE args[4]; window = newwin(NUM2INT(lines), NUM2INT(cols), NUM2INT(top), NUM2INT(left)); wclear(window); w = prep_window(class, window); - rb_obj_call_init(w); + args[0] = lines; args[1] = cols; args[2] = top; args[3] = left; + rb_obj_call_init(w, 4, args); return w; } @@ -428,11 +440,17 @@ window_subwin(obj, lines, cols, top, left) { struct windata *winp; WINDOW *window; + VALUE w; + VALUE args[4]; GetWINDOW(obj, winp); window = subwin(winp->window, NUM2INT(lines), NUM2INT(cols), NUM2INT(top), NUM2INT(left)); - return prep_window(cWindow, window); + w = prep_window(cWindow, window); + args[0] = lines; args[1] = cols; args[2] = top; args[3] = left; + rb_obj_call_init(w, 4, args); + + return w; } /* def close */ @@ -717,6 +735,7 @@ window_getch(obj) { struct windata *winp; + rb_read_check(stdin); GetWINDOW(obj, winp); return CHR2FIX(wgetch(winp->window)); } @@ -730,6 +749,7 @@ window_getstr(obj) char rtn[1024]; /* This should be big enough.. I hope */ GetWINDOW(obj, winp); + rb_read_check(stdin); wgetstr(winp->window, rtn); return rb_tainted_str_new2(rtn); } diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 442a9424a..e1bf24c43 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -1,22 +1,21 @@ require 'mkmf' -$CFLAGS="-I/usr/include/ncurses -I/usr/local/include/ncurses" -$LDFLAGS="-L/usr/local/lib" -make=FALSE +make=false have_library("mytinfo", "tgetent") if /bow/ =~ PLATFORM if have_header("ncurses.h") and have_library("ncurses", "initscr") - make=TRUE + make=true elsif have_header("ncurses/curses.h") and have_library("ncurses", "initscr") - make=TRUE + make=true +elsif have_header("curses_colr/curses.h") and have_library("cur_colr", "initscr") + make=true else - $CFLAGS=nil have_library("termcap", "tgetent") if have_library("curses", "initscr") - make=TRUE + make=true end end -if make then +if make for f in %w(isendwin ungetch beep doupdate flash deleteln wdeleteln) have_func(f) end -- cgit