summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-02-14 11:23:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-02-17 08:23:37 +0100
commit7e66707c7662c50c82c6eb62668134e3e342c34f (patch)
treeac0d254d0b610591b7e862fc508c701feb3e8ff0 /lib
parent9bdef9e7f2955728dddc189b03d587e42c950ce3 (diff)
downloadbarebox-7e66707c7662c50c82c6eb62668134e3e342c34f.tar.gz
barebox-7e66707c7662c50c82c6eb62668134e3e342c34f.tar.xz
input: Add BB_ prefix to KEY_ defines
Our KEY_ defines conflict with the standard Linux KEY_ defines, so add a BB_ prefix to them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/readkey.c36
-rw-r--r--lib/readline.c26
2 files changed, 31 insertions, 31 deletions
diff --git a/lib/readkey.c b/lib/readkey.c
index 89cc1546d0..7b38110113 100644
--- a/lib/readkey.c
+++ b/lib/readkey.c
@@ -29,24 +29,24 @@ struct esc_cmds {
};
static const struct esc_cmds esccmds[] = {
- {"OA", KEY_UP}, // cursor key Up
- {"OB", KEY_DOWN}, // cursor key Down
- {"OC", KEY_RIGHT}, // Cursor Key Right
- {"OD", KEY_LEFT}, // cursor key Left
- {"OH", KEY_HOME}, // Cursor Key Home
- {"OF", KEY_END}, // Cursor Key End
- {"[A", KEY_UP}, // cursor key Up
- {"[B", KEY_DOWN}, // cursor key Down
- {"[C", KEY_RIGHT}, // Cursor Key Right
- {"[D", KEY_LEFT}, // cursor key Left
- {"[H", KEY_HOME}, // Cursor Key Home
- {"[F", KEY_END}, // Cursor Key End
- {"[1~", KEY_HOME}, // Cursor Key Home
- {"[2~", KEY_INSERT}, // Cursor Key Insert
- {"[3~", KEY_DEL}, // Cursor Key Delete
- {"[4~", KEY_END}, // Cursor Key End
- {"[5~", KEY_PAGEUP}, // Cursor Key Page Up
- {"[6~", KEY_PAGEDOWN},// Cursor Key Page Down
+ {"OA", BB_KEY_UP}, // cursor key Up
+ {"OB", BB_KEY_DOWN}, // cursor key Down
+ {"OC", BB_KEY_RIGHT}, // Cursor Key Right
+ {"OD", BB_KEY_LEFT}, // cursor key Left
+ {"OH", BB_KEY_HOME}, // Cursor Key Home
+ {"OF", BB_KEY_END}, // Cursor Key End
+ {"[A", BB_KEY_UP}, // cursor key Up
+ {"[B", BB_KEY_DOWN}, // cursor key Down
+ {"[C", BB_KEY_RIGHT}, // Cursor Key Right
+ {"[D", BB_KEY_LEFT}, // cursor key Left
+ {"[H", BB_KEY_HOME}, // Cursor Key Home
+ {"[F", BB_KEY_END}, // Cursor Key End
+ {"[1~", BB_KEY_HOME}, // Cursor Key Home
+ {"[2~", BB_KEY_INSERT}, // Cursor Key Insert
+ {"[3~", BB_KEY_DEL}, // Cursor Key Delete
+ {"[4~", BB_KEY_END}, // Cursor Key End
+ {"[5~", BB_KEY_PAGEUP}, // Cursor Key Page Up
+ {"[6~", BB_KEY_PAGEDOWN},// Cursor Key Page Down
};
int read_key(void)
diff --git a/lib/readline.c b/lib/readline.c
index 6afc4918ea..240a131d96 100644
--- a/lib/readline.c
+++ b/lib/readline.c
@@ -233,19 +233,19 @@ int readline(const char *prompt, char *buf, int len)
#endif
break;
- case KEY_HOME:
+ case BB_KEY_HOME:
BEGINNING_OF_LINE();
break;
case CTL_CH('c'): /* ^C - break */
*buf = 0; /* discard input */
return -1;
- case KEY_RIGHT:
+ case BB_KEY_RIGHT:
if (num < eol_num) {
getcmd_putch(buf[num]);
num++;
}
break;
- case KEY_LEFT:
+ case BB_KEY_LEFT:
if (num) {
getcmd_putch(CTL_BACKSPACE);
num--;
@@ -266,28 +266,28 @@ int readline(const char *prompt, char *buf, int len)
eol_num--;
}
break;
- case KEY_ERASE_TO_EOL:
+ case BB_KEY_ERASE_TO_EOL:
ERASE_TO_EOL();
break;
- case KEY_REFRESH_TO_EOL:
- case KEY_END:
+ case BB_KEY_REFRESH_TO_EOL:
+ case BB_KEY_END:
REFRESH_TO_EOL();
break;
- case KEY_INSERT:
+ case BB_KEY_INSERT:
insert = !insert;
break;
- case KEY_ERASE_LINE:
+ case BB_KEY_ERASE_LINE:
BEGINNING_OF_LINE();
ERASE_TO_EOL();
break;
case DEL:
- case KEY_DEL7:
+ case BB_KEY_DEL7:
case 8:
if (num) {
DO_BACKSPACE();
}
break;
- case KEY_DEL:
+ case BB_KEY_DEL:
if (num < eol_num) {
wlen = eol_num - num;
memmove(buf + num, buf + num + 1, wlen);
@@ -299,12 +299,12 @@ int readline(const char *prompt, char *buf, int len)
eol_num--;
}
break;
- case KEY_UP:
- case KEY_DOWN:
+ case BB_KEY_UP:
+ case BB_KEY_DOWN:
{
char * hline;
- if (ichar == KEY_UP)
+ if (ichar == BB_KEY_UP)
hline = hist_prev();
else
hline = hist_next();