summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2006-12-18 17:46:25 +0100
committerMichael Brown2006-12-18 17:46:25 +0100
commit2ed2b2efe842eac526ecdd74f147ea02f52daf29 (patch)
treeaad3c0770c216113aad2ec6e2b2b8dcd3c097b34 /src
parentThe "increment MAC address by port number" hack applies only to EF1. (diff)
downloadipxe-2ed2b2efe842eac526ecdd74f147ea02f52daf29.tar.gz
ipxe-2ed2b2efe842eac526ecdd74f147ea02f52daf29.tar.xz
ipxe-2ed2b2efe842eac526ecdd74f147ea02f52daf29.zip
Use iskey() and getchar() to interact with console, rather than object
abstraction.
Diffstat (limited to 'src')
-rw-r--r--src/hci/mucurses/kb.c5
-rw-r--r--src/include/curses.h15
-rw-r--r--src/tests/curses_scr.c4
3 files changed, 5 insertions, 19 deletions
diff --git a/src/hci/mucurses/kb.c b/src/hci/mucurses/kb.c
index 63948469..1d02a0c8 100644
--- a/src/hci/mucurses/kb.c
+++ b/src/hci/mucurses/kb.c
@@ -1,6 +1,7 @@
#include <curses.h>
#include <stddef.h>
#include <timer.h>
+#include <console.h>
#include "core.h"
/** @file
@@ -37,7 +38,7 @@ int _wgetc ( WINDOW *win ) {
return ERR;
timer = INPUT_DELAY_TIMEOUT;
- while ( ! win->scr->peek( win->scr ) ) {
+ while ( ! iskey() ) {
if ( m_delay == 0 ) // non-blocking read
return ERR;
if ( timer > 0 ) { // time-limited blocking read
@@ -47,7 +48,7 @@ int _wgetc ( WINDOW *win ) {
} else { return ERR; } // non-blocking read
}
- c = win->scr->getc( win->scr );
+ c = getchar();
if ( m_echo && ( c >= 32 && c <= 126 ) ) // printable ASCII characters
_wputch( win, (chtype) ( c | win->attrs ), WRAP );
diff --git a/src/include/curses.h b/src/include/curses.h
index 27edb376..86825be4 100644
--- a/src/include/curses.h
+++ b/src/include/curses.h
@@ -46,21 +46,6 @@ typedef struct _curses_screen {
* @v c character to be written
*/
void ( * putc ) ( struct _curses_screen *scr, chtype c );
- /**
- * Pop a character from the keyboard input stream
- *
- * @v scr screen on which to operate
- * @ret c popped character
- */
- int ( * getc ) ( struct _curses_screen *scr );
- /**
- * Checks to see whether a character is waiting in the input stream
- *
- * @v scr screen on which to operate
- * @ret TRUE character waiting in stream
- * @ret FALSE no character waiting in stream
- */
- bool ( *peek ) ( struct _curses_screen *scr );
} SCREEN;
/** Curses Window struct */
diff --git a/src/tests/curses_scr.c b/src/tests/curses_scr.c
index 398b9cf9..63e114ac 100644
--- a/src/tests/curses_scr.c
+++ b/src/tests/curses_scr.c
@@ -83,6 +83,6 @@ SCREEN _curscr = {
.exit = _exit_screen,
.movetoyx = _movetoyx,
.putc = _putc,
- .getc = _getc,
- .peek = _peek,
+ // .getc = _getc,
+ // .peek = _peek,
};