aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-09-10 11:39:59 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-09-10 11:39:59 -0500
commit8568b5bc640288cac828c970335b8fdc51f0116a (patch)
tree8aacf662752b0ae735799e764b336c47810b55ab
parent38b01556e861ddee324b6630c4fe9d0b3323ca0c (diff)
downloadluancurses-8568b5bc640288cac828c970335b8fdc51f0116a.tar.gz
luancurses-8568b5bc640288cac828c970335b8fdc51f0116a.zip
implementing delete functions
-rw-r--r--src/curses.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/curses.c b/src/curses.c
index 3b7f3fb..1c2337e 100644
--- a/src/curses.c
+++ b/src/curses.c
@@ -430,6 +430,42 @@ static int l_clrtoeol(lua_State* L)
return 1;
}
+static int l_delch(lua_State* L)
+{
+ pos p;
+
+ if (get_pos(L, &p)) {
+ lua_pushboolean(L, mvdelch(p.y, p.x) == OK);
+ }
+ else {
+ lua_pushboolean(L, delch() == OK);
+ }
+
+ return 1;
+}
+
+static int l_deleteln(lua_State* L)
+{
+ lua_pushboolean(L, (deleteln() == OK));
+ return 1;
+}
+
+static int l_insdelln(lua_State* L)
+{
+ int n;
+
+ n = luaL_checkinteger(L, 1);
+
+ lua_pushboolean(L, (insertln() == OK));
+ return 1;
+}
+
+static int l_insertln(lua_State* L)
+{
+ lua_pushboolean(L, (insertln() == OK));
+ return 1;
+}
+
static int l_refresh(lua_State* L)
{
lua_pushboolean(L, (refresh() == OK));
@@ -484,6 +520,10 @@ const luaL_Reg reg[] = {
{ "clear", l_clear },
{ "clrtobot", l_clrtobot },
{ "clrtoeol", l_clrtoeol },
+ { "delch", l_delch },
+ { "deleteln", l_deleteln },
+ { "insdelln", l_insdelln },
+ { "insertln", l_insertln },
{ "refresh", l_refresh },
{ "getmaxyx", l_getmaxyx },
{ "getyx", l_getyx },