From: ciceron Date: Fri, 20 Jul 2001 22:17:49 +0000 (+0000) Subject: * tuiCommand.c (tuiDispatchCtrlChar): Fix escape sequences. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9b347388b0db147e5b0ccb243635f5feec674e49;p=pf3gnuchains%2Fpf3gnuchains3x.git * tuiCommand.c (tuiDispatchCtrlChar): Fix escape sequences. (tuiIncrCommandCharCountBy): Remove. (tuiDecrCommandCharCountBy): Remove. (tuiSetCommandCharCountTo): Remove. (tuiClearCommandCharCount): Remove. --- diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 59f2b1ffe4..0a3d359bdd 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,12 @@ +2001-07-21 Stephane Carrez + + * tuiCommand.h: Remove unused declarations. + * tuiCommand.c (tuiDispatchCtrlChar): Fix escape sequences. + (tuiIncrCommandCharCountBy): Remove. + (tuiDecrCommandCharCountBy): Remove. + (tuiSetCommandCharCountTo): Remove. + (tuiClearCommandCharCount): Remove. + 2001-07-20 Stephane Carrez * tuiWin.c (_initialize_tuiWin): Always define the tui commands; diff --git a/gdb/tui/tuiCommand.c b/gdb/tui/tuiCommand.c index 3611a4b9e3..0f5a66d8cc 100644 --- a/gdb/tui/tuiCommand.c +++ b/gdb/tui/tuiCommand.c @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include #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 ** -******************************************/ +} diff --git a/gdb/tui/tuiCommand.h b/gdb/tui/tuiCommand.h index 6e0e774e84..7afeb1bb39 100644 --- a/gdb/tui/tuiCommand.h +++ b/gdb/tui/tuiCommand.h @@ -37,10 +37,6 @@ ******************************************/ extern unsigned int tuiDispatchCtrlChar (unsigned int); -extern int tuiIncrCommandCharCountBy (int); -extern int tuiDecrCommandCharCountBy (int); -extern int tuiSetCommandCharCountTo (int); -extern int tuiClearCommandCharCount (void); #endif /*_TUI_COMMAND_H*/