1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/curses/curses.c (curses_escdelay_set): support ESCDELAY. a

patch from Giancarlo F Bellido <support@coaxialhost.com> in
  [ruby-core:19961].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-11-21 18:35:11 +00:00
parent b58ed03759
commit 137b5ecd8d
3 changed files with 31 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Fri Nov 21 22:24:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/curses/curses.c (curses_escdelay_set): support ESCDELAY. a
patch from Giancarlo F Bellido <support@coaxialhost.com> in
[ruby-core:19961].
Fri Nov 21 22:17:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.c (usage): -W description updated. [ruby-core:19858]

View file

@ -572,6 +572,27 @@ curses_bkgd(VALUE obj, VALUE ch)
#endif
}
static VALUE
curses_escdelay_set(VALUE obj, VALUE val)
{
#if defined(HAVE_ESCDELAY)
ESCDELAY=NUM2INT(val);
return INT2NUM(ESCDELAY);
#else
rb_notimplement();
#endif
}
static VALUE
curses_escdelay_get(VALUE obj)
{
#if defined(HAVE_ESCDELAY)
return INT2NUM(ESCDELAY);
#else
rb_notimplement();
#endif
}
static VALUE
curses_resizeterm(VALUE obj, VALUE lin, VALUE col)
{
@ -1419,6 +1440,8 @@ Init_curses(void)
rb_define_method(cMouseEvent, "bstate", curs_mouse_bstate, 0);
#endif /* USE_MOUSE */
rb_define_module_function(mCurses, "ESCDELAY=", curses_escdelay_set, 1);
rb_define_module_function(mCurses, "ESCDELAY", curses_escdelay_get, 0);
rb_define_module_function(mCurses, "init_screen", curses_init_screen, 0);
rb_define_module_function(mCurses, "close_screen", curses_close_screen, 0);
rb_define_module_function(mCurses, "closed?", curses_closed, 0);

View file

@ -6,6 +6,7 @@ dir_config('termcap')
make=false
headers = []
have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
have_library("tinfo", "tgetent") or have_library("termcap", "tgetent")
if have_header(*curses=%w"ncurses.h") and have_library("ncurses", "initscr")
@ -27,5 +28,6 @@ if make
if try_static_assert("sizeof(char*)>sizeof(int)", %w[stdio.h stdlib.h]+curses , flag)
$defs << flag
end
have_var("ESCDELAY", curses)
create_makefile("curses")
end