aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-03-18 09:10:30 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-03-18 09:10:30 -0500
commit49a112dbb8a52576e884ed131bd6e599ede8466c (patch)
treea4964896c3fa31626a4f25d8481d81334cf9f99f
parent25351c902726ddbb8d14871e0c6f6fdb7ded149e (diff)
downloadluancurses-49a112dbb8a52576e884ed131bd6e599ede8466c.tar.gz
luancurses-49a112dbb8a52576e884ed131bd6e599ede8466c.zip
implement beep() and flash()
-rw-r--r--TODO1
-rw-r--r--src/curses.c14
2 files changed, 14 insertions, 1 deletions
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 },
};