ruby-changes:11569
From: akr <ko1@a...>
Date: Sat, 18 Apr 2009 21:09:39 +0900 (JST)
Subject: [ruby-changes:11569] Ruby:r23203 (trunk): * ext/curses/curses.c: use rb_f_notimplement for methods not
akr 2009-04-18 21:09:23 +0900 (Sat, 18 Apr 2009) New Revision: 23203 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23203 Log: * ext/curses/curses.c: use rb_f_notimplement for methods not implemented. Modified files: trunk/ChangeLog trunk/ext/curses/curses.c Index: ChangeLog =================================================================== --- ChangeLog (revision 23202) +++ ChangeLog (revision 23203) @@ -1,3 +1,8 @@ +Sat Apr 18 21:07:34 2009 Tanaka Akira <akr@f...> + + * ext/curses/curses.c: use rb_f_notimplement for methods not + implemented. + Fri Apr 17 01:51:17 2009 Tanaka Akira <akr@f...> * node.h (rb_notimplement_body_p): declared. Index: ext/curses/curses.c =================================================================== --- ext/curses/curses.c (revision 23202) +++ ext/curses/curses.c (revision 23203) @@ -159,19 +159,19 @@ rb_gc_unregister_address(&rb_stdscr); } +#ifdef HAVE_ISENDWIN /* def closed? */ static VALUE curses_closed(void) { -#ifdef HAVE_ISENDWIN if (isendwin()) { return Qtrue; } return Qfalse; +} #else - rb_notimplement(); +#define curses_closed rb_f_notimplement #endif -} /* def clear */ static VALUE @@ -328,19 +328,19 @@ } } +#ifdef HAVE_UNGETCH /* def ungetch */ static VALUE curses_ungetch(VALUE obj, VALUE ch) { -#ifdef HAVE_UNGETCH int c = curses_char(ch); curses_stdscr(); ungetch(c); + return Qnil; +} #else - rb_notimplement(); +#define curses_ungetch rb_f_notimplement #endif - return Qnil; -} /* def setpos(y, x) */ static VALUE @@ -578,58 +578,58 @@ #endif } +#if defined(HAVE_USE_DEFAULT_COLORS) static VALUE curses_use_default_colors(VALUE obj) { -#if defined(HAVE_USE_DEFAULT_COLORS) use_default_colors(); return Qnil; +} #else - rb_notimplement(); +#define curses_use_default_colors rb_f_notimplement #endif -} +#if defined(HAVE_TABSIZE) static VALUE curses_tabsize_set(VALUE obj, VALUE val) { -#if defined(HAVE_TABSIZE) TABSIZE = NUM2INT(val); return INT2NUM(TABSIZE); +} #else - rb_notimplement(); +#define curses_tabsize_set rb_f_notimplement #endif -} +#if defined(HAVE_TABSIZE) static VALUE curses_tabsize_get(VALUE ojb) { -#if defined(HAVE_TABSIZE) return INT2NUM(TABSIZE); +} #else - rb_notimplement(); +#define curses_tabsize_get rb_f_notimplement #endif -} +#if defined(HAVE_ESCDELAY) static VALUE curses_escdelay_set(VALUE obj, VALUE val) { -#if defined(HAVE_ESCDELAY) ESCDELAY = NUM2INT(val); return INT2NUM(ESCDELAY); +} #else - rb_notimplement(); +#define curses_escdelay_set rb_f_notimplement #endif -} +#if defined(HAVE_ESCDELAY) static VALUE curses_escdelay_get(VALUE obj) { -#if defined(HAVE_ESCDELAY) return INT2NUM(ESCDELAY); +} #else - rb_notimplement(); +#define curses_escdelay_get rb_f_notimplement #endif -} static VALUE curses_resizeterm(VALUE obj, VALUE lin, VALUE col) @@ -676,15 +676,15 @@ return can_change_color() ? Qtrue : Qfalse; } +#if defined(HAVE_COLORS) static VALUE curses_colors(VALUE obj) { -#if defined(HAVE_COLORS) return INT2FIX(COLORS); +} #else - rb_notimplement(); +#define curses_colors rb_f_notimplement #endif -} static VALUE curses_color_content(VALUE obj, VALUE color) @@ -696,15 +696,15 @@ } +#if defined(HAVE_COLOR_PAIRS) static VALUE curses_color_pairs(VALUE obj) { -#if defined(HAVE_COLOR_PAIRS) return INT2FIX(COLOR_PAIRS); +} #else - rb_notimplement(); +#define curses_color_pairs rb_f_notimplement #endif -} static VALUE curses_pair_content(VALUE obj, VALUE pair) @@ -802,36 +802,36 @@ #undef define_curs_mouse_member #endif /* USE_MOUSE */ +#ifdef HAVE_TIMEOUT static VALUE curses_timeout(VALUE obj, VALUE delay) { -#ifdef HAVE_TIMEOUT timeout(NUM2INT(delay)); return Qnil; +} #else - rb_notimplement(); +#define curses_timeout rb_f_notimplement #endif -} +#ifdef HAVE_DEF_PROG_MODE static VALUE curses_def_prog_mode(VALUE obj) { -#ifdef HAVE_DEF_PROG_MODE return def_prog_mode() == OK ? Qtrue : Qfalse; +} #else - rb_notimplement(); +#define curses_def_prog_mode rb_f_notimplement #endif -} +#ifdef HAVE_RESET_PROG_MODE static VALUE curses_reset_prog_mode(VALUE obj) { -#ifdef HAVE_RESET_PROG_MODE return reset_prog_mode() == OK ? Qtrue : Qfalse; +} #else - rb_notimplement(); +#define curses_reset_prog_mode rb_f_notimplement #endif -} /*-------------------------- class Window --------------------------*/ @@ -1426,10 +1426,10 @@ } +#ifdef HAVE_KEYPAD static VALUE window_keypad(VALUE obj, VALUE val) { -#ifdef HAVE_KEYPAD struct windata *winp; GetWINDOW(obj,winp); @@ -1442,15 +1442,15 @@ return (keypad(winp->window,RTEST(val) ? TRUE : FALSE)) == OK ? Qtrue : Qfalse; #endif +} #else - rb_notimplement(); -#endif /* HAVE_KEYPAD */ -} +#define window_keypad rb_f_notimplement +#endif +#ifdef HAVE_NODELAY static VALUE window_nodelay(VALUE obj, VALUE val) { -#ifdef HAVE_NODELAY struct windata *winp; GetWINDOW(obj,winp); @@ -1461,24 +1461,24 @@ #else return nodelay(winp->window,RTEST(val) ? TRUE : FALSE) == OK ? Qtrue : Qfalse; #endif +} #else - rb_notimplement(); +#define window_nodelay rb_f_notimplement #endif -} +#ifdef HAVE_WTIMEOUT static VALUE window_timeout(VALUE obj, VALUE delay) { -#ifdef HAVE_WTIMEOUT struct windata *winp; GetWINDOW(obj,winp); wtimeout(winp->window,NUM2INT(delay)); return Qnil; +} #else - rb_notimplement(); +#define window_timeout rb_f_notimplement #endif -} /*------------------------- Initialization -------------------------*/ void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/