aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tuiCommand.c
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2001-07-20 22:17:49 +0000
committerStephane Carrez <stcarrez@nerim.fr>2001-07-20 22:17:49 +0000
commit9b2d6ccae7105a8c8a002828bc95925d3e240be0 (patch)
treeddb5bf864acaafc83566c9d01f648c45113da5be /gdb/tui/tuiCommand.c
parent5c883cdc505ddcef984e4e01283ed798201a7a71 (diff)
downloadgdb-9b2d6ccae7105a8c8a002828bc95925d3e240be0.zip
gdb-9b2d6ccae7105a8c8a002828bc95925d3e240be0.tar.gz
gdb-9b2d6ccae7105a8c8a002828bc95925d3e240be0.tar.bz2
* tuiCommand.c (tuiDispatchCtrlChar): Fix escape sequences.
(tuiIncrCommandCharCountBy): Remove. (tuiDecrCommandCharCountBy): Remove. (tuiSetCommandCharCountTo): Remove. (tuiClearCommandCharCount): Remove.
Diffstat (limited to 'gdb/tui/tuiCommand.c')
-rw-r--r--gdb/tui/tuiCommand.c99
1 files changed, 12 insertions, 87 deletions
diff --git a/gdb/tui/tuiCommand.c b/gdb/tui/tuiCommand.c
index 3611a4b..0f5a66d 100644
--- a/gdb/tui/tuiCommand.c
+++ b/gdb/tui/tuiCommand.c
@@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include <ctype.h>
#include "tui.h"
#include "tuiData.h"
#include "tuiWin.h"
@@ -44,6 +45,7 @@ unsigned int
tuiDispatchCtrlChar (unsigned int ch)
{
TuiWinInfoPtr winInfo = tuiWinWithFocus ();
+ WINDOW *w = cmdWin->generic.handle;
/*
** If the command window has the logical focus, or no-one does
@@ -72,13 +74,21 @@ tuiDispatchCtrlChar (unsigned int ch)
tmpChar = 0;
while (!m_isEndSequence (tmpChar))
{
- tmpChar = (int) wgetch (cmdWin->generic.handle);
+ tmpChar = (int) wgetch (w);
+ if (tmpChar == ERR)
+ {
+ return ch;
+ }
if (!tmpChar)
break;
if (tmpChar == 53)
pageCh = KEY_PPAGE;
else if (tmpChar == 54)
pageCh = KEY_NPAGE;
+ else
+ {
+ return 0;
+ }
}
chCopy = pageCh;
}
@@ -114,89 +124,4 @@ tuiDispatchCtrlChar (unsigned int ch)
}
return c;
}
-} /* tuiDispatchCtrlChar */
-
-
-/*
- ** tuiIncrCommandCharCountBy()
- ** Increment the current character count in the command window,
- ** checking for overflow. Returns the new value of the char count.
- */
-int
-tuiIncrCommandCharCountBy (int count)
-{
- if (tui_version)
- {
- if ((count + cmdWin->detail.commandInfo.curch) >= cmdWin->generic.width)
- cmdWin->detail.commandInfo.curch =
- (count + cmdWin->detail.commandInfo.curch) - cmdWin->generic.width;
- else
- cmdWin->detail.commandInfo.curch += count;
- }
-
- return cmdWin->detail.commandInfo.curch;
-} /* tuiIncrCommandCharCountBy */
-
-
-/*
- ** tuiDecrCommandCharCountBy()
- ** Decrement the current character count in the command window,
- ** checking for overflow. Returns the new value of the char count.
- */
-int
-tuiDecrCommandCharCountBy (int count)
-{
- if (tui_version)
- {
- if ((cmdWin->detail.commandInfo.curch - count) < 0)
- cmdWin->detail.commandInfo.curch =
- cmdWin->generic.width + (cmdWin->detail.commandInfo.curch - count);
- else
- cmdWin->detail.commandInfo.curch -= count;
- }
-
- return cmdWin->detail.commandInfo.curch;
-} /* tuiDecrCommandCharCountBy */
-
-
-/*
- ** tuiSetCommandCharCountTo()
- ** Set the character count to count.
- */
-int
-tuiSetCommandCharCountTo (int count)
-{
- if (tui_version)
- {
- if (count > cmdWin->generic.width - 1)
- {
- cmdWin->detail.commandInfo.curch = 0;
- tuiIncrCommandCharCountBy (count);
- }
- else
- cmdWin->detail.commandInfo.curch -= count;
- }
-
- return cmdWin->detail.commandInfo.curch;
-} /* tuiSetCommandCharCountTo */
-
-
-
-/*
- ** tuiClearCommandCharCount()
- ** Clear the character count to count.
- */
-int
-tuiClearCommandCharCount (void)
-{
- if (tui_version)
- cmdWin->detail.commandInfo.curch = 0;
-
- return cmdWin->detail.commandInfo.curch;
-} /* tuiClearCommandCharCount */
-
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS **
-******************************************/
+}