summaryrefslogtreecommitdiffstats
path: root/src/filo/main/console_x.c
diff options
context:
space:
mode:
authorMichael Brown2006-03-17 15:09:45 +0100
committerMichael Brown2006-03-17 15:09:45 +0100
commita2b15fd1febc77aecfc99b9d366b13f0bc17bebd (patch)
tree47cef6e48756f1d39f6404af8de70023a72c10bb /src/filo/main/console_x.c
parentPrefix semantics have changed (diff)
downloadipxe-a2b15fd1febc77aecfc99b9d366b13f0bc17bebd.tar.gz
ipxe-a2b15fd1febc77aecfc99b9d366b13f0bc17bebd.tar.xz
ipxe-a2b15fd1febc77aecfc99b9d366b13f0bc17bebd.zip
GPXE code cleanup and purge.
Diffstat (limited to 'src/filo/main/console_x.c')
-rw-r--r--src/filo/main/console_x.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/src/filo/main/console_x.c b/src/filo/main/console_x.c
deleted file mode 100644
index fd04a9392..000000000
--- a/src/filo/main/console_x.c
+++ /dev/null
@@ -1,74 +0,0 @@
-
-#include "etherboot.h"
-
-#include <lib.h>
-
-int getline(char *buf, int max)
-{
- int cur, ch, nonspace_seen;
-
- cur = 0;
- while (buf[cur]) {
- putchar(buf[cur]);
- cur++;
- }
- for (;;) {
- ch = getchar();
- switch (ch) {
- /* end of line */
- case '\r':
- case '\n':
- putchar('\n');
- goto out;
- /* backspace */
- case '\b':
- case '\x7f':
- if (cur > 0) {
- cur--;
- putchar('\b');
- putchar(' ');
- putchar('\b');
- }
- break;
- /* word erase */
- case 'W' & 0x1f: /* ^W */
- nonspace_seen = 0;
- while (cur) {
- if (buf[cur-1] != ' ')
- nonspace_seen = 1;
- putchar('\b');
- putchar(' ');
- putchar('\b');
- cur--;
- if (nonspace_seen && cur < max-1 && cur > 0 && buf[cur-1]==' ')
- break;
- }
- break;
- /* line erase */
- case 'U' & 0x1f: /* ^U */
- while (cur) {
- putchar('\b');
- putchar(' ');
- putchar('\b');
- cur--;
- }
- cur = 0;
- break;
- default:
- if (ch < 0x20)
- break; /* ignore control char */
- if (ch >= 0x7f)
- break;
- if (cur + 1 < max) {
- putchar(ch); /* echo back */
- buf[cur] = ch;
- cur++;
- }
- }
- }
-out:
- if (cur >= max)
- cur = max - 1;
- buf[cur] = '\0';
- return cur;
-}