aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-io.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-01-19 05:06:34 +0000
committerAndrew Cagney <cagney@redhat.com>2004-01-19 05:06:34 +0000
commitbcdf15685fdb5cd64dc3026cb0f1ed7fa2e66cbe (patch)
treecab44a0bc71e6a6432018ccfdc828f6df69fa4fb /gdb/tui/tui-io.c
parent130d87e6f789b24f69cc38888670ebf9ce31529c (diff)
downloadgdb-bcdf15685fdb5cd64dc3026cb0f1ed7fa2e66cbe.zip
gdb-bcdf15685fdb5cd64dc3026cb0f1ed7fa2e66cbe.tar.gz
gdb-bcdf15685fdb5cd64dc3026cb0f1ed7fa2e66cbe.tar.bz2
2004-01-18 Andrew Cagney <cagney@redhat.com>
* tui/tui-io.c: Update copyright. (key_is_end_sequence, key_is_backspace): New functions. (key_is_command_char, key_is_start_sequence): New function. (tui_getc): Update references. * tui/tui-io.h: Update copyright. (m_tuiStartNewLine): Delete macro. (m_isBackspace, m_isDeleteChar): Delete macros. (m_isDeleteLine, m_isDeleteToEol): Delete macros. (m_isNextPage, m_isPrevPage): Delete macros. (m_isLeftArrow, m_isRightArrow): Delete macros. (m_isXdbStyleCommandChar): Delete macro. (key_is_start_sequence): Declare, replace m_isStartSequence. (key_is_end_sequence): Declare, replace m_isEndSequence. (key_is_backspace): Declare ,replace m_isBackspace. (key_is_command_char): Declare, replace m_isCommandChar. * tui/tui-command.c: Update copyright. (tuiDispatchCtrlChar): Update references.
Diffstat (limited to 'gdb/tui/tui-io.c')
-rw-r--r--gdb/tui/tui-io.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index e17971f..0cffd6e 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -1,7 +1,7 @@
/* TUI support I/O functions.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -51,6 +51,34 @@
#endif
#endif
+int
+key_is_start_sequence (int ch)
+{
+ return (ch == 27);
+}
+
+int
+key_is_end_sequence (int ch)
+{
+ return (ch == 126);
+}
+
+int
+key_is_backspace (int ch)
+{
+ return (ch == 8);
+}
+
+int
+key_is_command_char (int ch)
+{
+ return ((ch == KEY_NPAGE) || (ch == KEY_PPAGE)
+ || (ch == KEY_LEFT) || (ch == KEY_RIGHT)
+ || (ch == KEY_UP) || (ch == KEY_DOWN)
+ || (ch == KEY_SF) || (ch == KEY_SR)
+ || (ch == (int)'\f') || key_is_start_sequence (ch));
+}
+
/* Use definition from readline 4.3. */
#undef CTRL_CHAR
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
@@ -659,7 +687,7 @@ tui_getc (FILE *fp)
}
}
- if (m_isCommandChar (ch))
+ if (key_is_command_char (ch))
{ /* Handle prev/next/up/down here */
ch = tuiDispatchCtrlChar (ch);
}