summaryrefslogtreecommitdiffstats
path: root/src/hci/mucurses/clear.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci/mucurses/clear.c')
-rw-r--r--src/hci/mucurses/clear.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/hci/mucurses/clear.c b/src/hci/mucurses/clear.c
index 7e124c1d..3f5cf9e8 100644
--- a/src/hci/mucurses/clear.c
+++ b/src/hci/mucurses/clear.c
@@ -2,6 +2,12 @@
#include "core.h"
#include "cursor.h"
+/** @file
+ *
+ * MuCurses clearing functions
+ *
+ */
+
/**
* Clear a window to the bottom from current cursor position
*
@@ -39,6 +45,40 @@ int wclrtoeol ( WINDOW *win ) {
}
/**
+ * Delete character under the cursor in a window
+ *
+ * @v *win subject window
+ * @ret rc return status code
+ */
+int wdelch ( WINDOW *win ) {
+ struct cursor_pos pos;
+
+ _store_curs_pos( win, &pos );
+ _wputch( win, (unsigned)' ', NOWRAP );
+ _restore_curs_pos( win, &pos );
+
+ return OK;
+}
+
+/**
+ * Delete line under a window's cursor
+ *
+ * @v *win subject window
+ * @ret rc return status code
+ */
+int wdeleteln ( WINDOW *win ) {
+ struct cursor_pos pos;
+
+ _store_curs_pos( win, &pos );
+ /* let's just set the cursor to the beginning of the line and
+ let wclrtoeol do the work :) */
+ wmove( win, win->curs_y, 0 );
+ wclrtoeol( win );
+ _restore_curs_pos( win, &pos );
+ return OK;
+}
+
+/**
* Completely clear a window
*
* @v *win subject window