Skip to content

Commit

Permalink
create lowercase alias for COLOR_PAIR for compatibility with ruby Curses
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Jan 29, 2014
1 parent 741c15c commit ca02fad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ncurses_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,9 +761,18 @@ static VALUE rbncurs_color_set(VALUE dummy, VALUE arg1, VALUE arg2) {
return INT2NUM(color_set(NUM2INT(arg1), ((void)(arg2),NULL)));
}
#endif



static VALUE rbncurs_COLOR_PAIR(VALUE dummy, VALUE arg1) {
return INT2NUM(COLOR_PAIR(NUM2INT(arg1)));
}

// alias for COLOR_PAIR for compatibilty with ruby Curses gem.
static VALUE rbncurs_color_pair(VALUE dummy, VALUE arg1) {
return rbncurs_COLOR_PAIR (dummy, arg1);
}

static VALUE rbncurs_copywin(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7, VALUE arg8, VALUE arg9) {
return INT2NUM(copywin(get_window(arg1), get_window(arg2), NUM2INT(arg3), NUM2INT(arg4), NUM2INT(arg5), NUM2INT(arg6), NUM2INT(arg7), NUM2INT(arg8), NUM2INT(arg9)));
}
Expand Down Expand Up @@ -1808,6 +1817,7 @@ static void init_functions_2(void) {
NCFUNC(color_set, 2);
#endif
NCFUNC(COLOR_PAIR, 1);
NCFUNC(color_pair, 1);
NCFUNC(copywin, 9);
NCFUNC(curs_set, 1);
NCFUNC(def_prog_mode, 0);
Expand Down

0 comments on commit ca02fad

Please sign in to comment.