Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create lowercase alias for COLOR_PAIR for compatibility with ruby Curses #23

Merged
merged 1 commit into from
Jan 30, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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