diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/curses/curses.c | 23 | ||||
-rw-r--r-- | ext/curses/extconf.rb | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 778bee4da9..9f4e02ef42 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -573,6 +573,27 @@ curses_bkgd(VALUE obj, VALUE ch) } 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) { #if defined(HAVE_RESIZETERM) @@ -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); diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 799d1bfe5f..3aa91702e3 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -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 |