From 49a112dbb8a52576e884ed131bd6e599ede8466c Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Tue, 18 Mar 2008 09:10:30 -0500 Subject: implement beep() and flash() --- TODO | 1 - src/curses.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 55568aa..63050b4 100644 --- a/TODO +++ b/TODO @@ -6,7 +6,6 @@ - finish up curs_inopts and curs_outopts - finish up curs_color (color_content, pair_content) - scrolling support (curs_scroll) -- curs_beep - support the rest of the refresh options (curs_refresh) - window background support (curs_bkgd) - multiple window support (all fns that start with w, curs_overlay, curs_initscr, curs_window, curs_getyx (par, beg), curs_touch, curs_overlay) diff --git a/src/curses.c b/src/curses.c index 23e07cb..b1bdb14 100644 --- a/src/curses.c +++ b/src/curses.c @@ -598,6 +598,18 @@ static int l_color_pairs(lua_State* L) return 1; } +static int l_beep(lua_State* L) +{ + lua_pushboolean(L, (beep() == OK)); + return 1; +} + +static int l_flash(lua_State* L) +{ + lua_pushboolean(L, (beep() == OK)); + return 1; +} + const luaL_Reg reg[] = { { "initscr", l_initscr }, { "endwin", l_endwin }, @@ -626,6 +638,8 @@ const luaL_Reg reg[] = { { "getyx", l_getyx }, { "colors", l_colors }, { "color_pairs", l_color_pairs }, + { "beep", l_beep }, + { "flash", l_flash }, { NULL, NULL }, }; -- cgit v1.2.3