mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/curses/curses.c: use rb_f_notimplement for methods not
implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1196098343
commit
be2d3f5979
2 changed files with 65 additions and 60 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Apr 18 21:07:34 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/curses/curses.c: use rb_f_notimplement for methods not
|
||||||
|
implemented.
|
||||||
|
|
||||||
Fri Apr 17 01:51:17 2009 Tanaka Akira <akr@fsij.org>
|
Fri Apr 17 01:51:17 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* node.h (rb_notimplement_body_p): declared.
|
* node.h (rb_notimplement_body_p): declared.
|
||||||
|
|
|
@ -159,19 +159,19 @@ curses_finalize(VALUE dummy)
|
||||||
rb_gc_unregister_address(&rb_stdscr);
|
rb_gc_unregister_address(&rb_stdscr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_ISENDWIN
|
||||||
/* def closed? */
|
/* def closed? */
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_closed(void)
|
curses_closed(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ISENDWIN
|
|
||||||
if (isendwin()) {
|
if (isendwin()) {
|
||||||
return Qtrue;
|
return Qtrue;
|
||||||
}
|
}
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_closed rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
/* def clear */
|
/* def clear */
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -328,19 +328,19 @@ curses_char(VALUE c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_UNGETCH
|
||||||
/* def ungetch */
|
/* def ungetch */
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_ungetch(VALUE obj, VALUE ch)
|
curses_ungetch(VALUE obj, VALUE ch)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_UNGETCH
|
|
||||||
int c = curses_char(ch);
|
int c = curses_char(ch);
|
||||||
curses_stdscr();
|
curses_stdscr();
|
||||||
ungetch(c);
|
ungetch(c);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_ungetch rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
/* def setpos(y, x) */
|
/* def setpos(y, x) */
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -578,58 +578,58 @@ curses_bkgd(VALUE obj, VALUE ch)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_USE_DEFAULT_COLORS)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_use_default_colors(VALUE obj)
|
curses_use_default_colors(VALUE obj)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_USE_DEFAULT_COLORS)
|
|
||||||
use_default_colors();
|
use_default_colors();
|
||||||
return Qnil;
|
return Qnil;
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_use_default_colors rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_TABSIZE)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_tabsize_set(VALUE obj, VALUE val)
|
curses_tabsize_set(VALUE obj, VALUE val)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_TABSIZE)
|
|
||||||
TABSIZE = NUM2INT(val);
|
TABSIZE = NUM2INT(val);
|
||||||
return INT2NUM(TABSIZE);
|
return INT2NUM(TABSIZE);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_tabsize_set rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_TABSIZE)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_tabsize_get(VALUE ojb)
|
curses_tabsize_get(VALUE ojb)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_TABSIZE)
|
|
||||||
return INT2NUM(TABSIZE);
|
return INT2NUM(TABSIZE);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_tabsize_get rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_ESCDELAY)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_escdelay_set(VALUE obj, VALUE val)
|
curses_escdelay_set(VALUE obj, VALUE val)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_ESCDELAY)
|
|
||||||
ESCDELAY = NUM2INT(val);
|
ESCDELAY = NUM2INT(val);
|
||||||
return INT2NUM(ESCDELAY);
|
return INT2NUM(ESCDELAY);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_escdelay_set rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_ESCDELAY)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_escdelay_get(VALUE obj)
|
curses_escdelay_get(VALUE obj)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_ESCDELAY)
|
|
||||||
return INT2NUM(ESCDELAY);
|
return INT2NUM(ESCDELAY);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_escdelay_get rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_resizeterm(VALUE obj, VALUE lin, VALUE col)
|
curses_resizeterm(VALUE obj, VALUE lin, VALUE col)
|
||||||
|
@ -676,15 +676,15 @@ curses_can_change_color(VALUE obj)
|
||||||
return can_change_color() ? Qtrue : Qfalse;
|
return can_change_color() ? Qtrue : Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_COLORS)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_colors(VALUE obj)
|
curses_colors(VALUE obj)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_COLORS)
|
|
||||||
return INT2FIX(COLORS);
|
return INT2FIX(COLORS);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_colors rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_color_content(VALUE obj, VALUE color)
|
curses_color_content(VALUE obj, VALUE color)
|
||||||
|
@ -696,15 +696,15 @@ curses_color_content(VALUE obj, VALUE color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(HAVE_COLOR_PAIRS)
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_color_pairs(VALUE obj)
|
curses_color_pairs(VALUE obj)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_COLOR_PAIRS)
|
|
||||||
return INT2FIX(COLOR_PAIRS);
|
return INT2FIX(COLOR_PAIRS);
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_color_pairs rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_pair_content(VALUE obj, VALUE pair)
|
curses_pair_content(VALUE obj, VALUE pair)
|
||||||
|
@ -802,36 +802,36 @@ DEFINE_MOUSE_GET_MEMBER(curs_mouse_bstate, bstate)
|
||||||
#undef define_curs_mouse_member
|
#undef define_curs_mouse_member
|
||||||
#endif /* USE_MOUSE */
|
#endif /* USE_MOUSE */
|
||||||
|
|
||||||
|
#ifdef HAVE_TIMEOUT
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_timeout(VALUE obj, VALUE delay)
|
curses_timeout(VALUE obj, VALUE delay)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_TIMEOUT
|
|
||||||
timeout(NUM2INT(delay));
|
timeout(NUM2INT(delay));
|
||||||
return Qnil;
|
return Qnil;
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_timeout rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_DEF_PROG_MODE
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_def_prog_mode(VALUE obj)
|
curses_def_prog_mode(VALUE obj)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DEF_PROG_MODE
|
|
||||||
return def_prog_mode() == OK ? Qtrue : Qfalse;
|
return def_prog_mode() == OK ? Qtrue : Qfalse;
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_def_prog_mode rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_RESET_PROG_MODE
|
||||||
static VALUE
|
static VALUE
|
||||||
curses_reset_prog_mode(VALUE obj)
|
curses_reset_prog_mode(VALUE obj)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_RESET_PROG_MODE
|
|
||||||
return reset_prog_mode() == OK ? Qtrue : Qfalse;
|
return reset_prog_mode() == OK ? Qtrue : Qfalse;
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define curses_reset_prog_mode rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------------------- class Window --------------------------*/
|
/*-------------------------- class Window --------------------------*/
|
||||||
|
|
||||||
|
@ -1426,10 +1426,10 @@ window_resize(VALUE obj, VALUE lin, VALUE col)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_KEYPAD
|
||||||
static VALUE
|
static VALUE
|
||||||
window_keypad(VALUE obj, VALUE val)
|
window_keypad(VALUE obj, VALUE val)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_KEYPAD
|
|
||||||
struct windata *winp;
|
struct windata *winp;
|
||||||
|
|
||||||
GetWINDOW(obj,winp);
|
GetWINDOW(obj,winp);
|
||||||
|
@ -1442,15 +1442,15 @@ window_keypad(VALUE obj, VALUE val)
|
||||||
return (keypad(winp->window,RTEST(val) ? TRUE : FALSE)) == OK ?
|
return (keypad(winp->window,RTEST(val) ? TRUE : FALSE)) == OK ?
|
||||||
Qtrue : Qfalse;
|
Qtrue : Qfalse;
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif /* HAVE_KEYPAD */
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define window_keypad rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_NODELAY
|
||||||
static VALUE
|
static VALUE
|
||||||
window_nodelay(VALUE obj, VALUE val)
|
window_nodelay(VALUE obj, VALUE val)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NODELAY
|
|
||||||
struct windata *winp;
|
struct windata *winp;
|
||||||
GetWINDOW(obj,winp);
|
GetWINDOW(obj,winp);
|
||||||
|
|
||||||
|
@ -1461,24 +1461,24 @@ window_nodelay(VALUE obj, VALUE val)
|
||||||
#else
|
#else
|
||||||
return nodelay(winp->window,RTEST(val) ? TRUE : FALSE) == OK ? Qtrue : Qfalse;
|
return nodelay(winp->window,RTEST(val) ? TRUE : FALSE) == OK ? Qtrue : Qfalse;
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define window_nodelay rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_WTIMEOUT
|
||||||
static VALUE
|
static VALUE
|
||||||
window_timeout(VALUE obj, VALUE delay)
|
window_timeout(VALUE obj, VALUE delay)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_WTIMEOUT
|
|
||||||
struct windata *winp;
|
struct windata *winp;
|
||||||
GetWINDOW(obj,winp);
|
GetWINDOW(obj,winp);
|
||||||
|
|
||||||
wtimeout(winp->window,NUM2INT(delay));
|
wtimeout(winp->window,NUM2INT(delay));
|
||||||
return Qnil;
|
return Qnil;
|
||||||
#else
|
|
||||||
rb_notimplement();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define window_timeout rb_f_notimplement
|
||||||
|
#endif
|
||||||
|
|
||||||
/*------------------------- Initialization -------------------------*/
|
/*------------------------- Initialization -------------------------*/
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue