summaryrefslogtreecommitdiffstats
path: root/src/hci/mucurses/clear.c
diff options
context:
space:
mode:
authorDan Lynch2006-06-21 12:27:52 +0200
committerDan Lynch2006-06-21 12:27:52 +0200
commit79a9aced26f80da11fa8ca52a79ce907ceacc201 (patch)
treed11bace1530706d11c441ed216a24bac0602e239 /src/hci/mucurses/clear.c
parentadded doxygen file header (diff)
downloadipxe-79a9aced26f80da11fa8ca52a79ce907ceacc201.tar.gz
ipxe-79a9aced26f80da11fa8ca52a79ce907ceacc201.tar.xz
ipxe-79a9aced26f80da11fa8ca52a79ce907ceacc201.zip
- added doxygen @file header
- wdeleteln function implemented
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