Bläddra i källkod

- added doxygen @file header

- wdeleteln function implemented
tags/v0.9.3
Dan Lynch 18 år sedan
förälder
incheckning
79a9aced26
1 ändrade filer med 40 tillägg och 0 borttagningar
  1. 40
    0
      src/hci/mucurses/clear.c

+ 40
- 0
src/hci/mucurses/clear.c Visa fil

@@ -2,6 +2,12 @@
2 2
 #include "core.h"
3 3
 #include "cursor.h"
4 4
 
5
+/** @file
6
+ *
7
+ * MuCurses clearing functions
8
+ *
9
+ */
10
+
5 11
 /**
6 12
  * Clear a window to the bottom from current cursor position
7 13
  *
@@ -38,6 +44,40 @@ int wclrtoeol ( WINDOW *win ) {
38 44
 	return OK;
39 45
 }
40 46
 
47
+/**
48
+ * Delete character under the cursor in a window
49
+ *
50
+ * @v *win	subject window
51
+ * @ret rc	return status code
52
+ */
53
+int wdelch ( WINDOW *win ) {
54
+	struct cursor_pos pos;
55
+
56
+	_store_curs_pos( win, &pos );
57
+	_wputch( win, (unsigned)' ', NOWRAP );
58
+	_restore_curs_pos( win, &pos );
59
+
60
+	return OK;
61
+}
62
+
63
+/**
64
+ * Delete line under a window's cursor
65
+ *
66
+ * @v *win	subject window
67
+ * @ret rc	return status code
68
+ */
69
+int wdeleteln ( WINDOW *win ) {
70
+	struct cursor_pos pos;
71
+
72
+	_store_curs_pos( win, &pos );
73
+	/* let's just set the cursor to the beginning of the line and
74
+	   let wclrtoeol do the work :) */
75
+	wmove( win, win->curs_y, 0 );
76
+	wclrtoeol( win );
77
+	_restore_curs_pos( win, &pos );
78
+	return OK;
79
+}
80
+
41 81
 /**
42 82
  * Completely clear a window
43 83
  *

Laddar…
Avbryt
Spara