#include "event-top.h"
#include "command.h"
#include "top.h"
-#include "readline/readline.h"
#include "tui/tui.h"
#include "tui/tui-data.h"
#include "tui/tui-io.h"
#include <signal.h>
#include <stdio.h>
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#else
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#endif
+#include "gdb_curses.h"
+
+/* This redefines CTRL if it is not already defined, so it must come
+ after terminal state releated include files like <term.h> and
+ "gdb_curses.h". */
+#include "readline/readline.h"
int
key_is_start_sequence (int ch)
This may be the main gdb prompt or a secondary prompt. */
static char *tui_rl_saved_prompt;
-static unsigned int _tuiHandleResizeDuringIO (unsigned int);
+static unsigned int tui_handle_resize_during_io (unsigned int);
static void
tui_putc (char c)
Comes from readline/complete.c */
static char *
-printable_part (pathname)
- char *pathname;
+printable_part (char *pathname)
{
char *temp;
} while (0)
static int
-print_filename (to_print, full_pathname)
- char *to_print, *full_pathname;
+print_filename (char *to_print, char *full_pathname)
{
int printed_len = 0;
char *s;
/* The user must press "y" or "n". Non-zero return means "y" pressed.
Comes from readline/complete.c */
static int
-get_y_or_n ()
+get_y_or_n (void)
{
extern int _rl_abort_internal ();
int c;
Comes from readline/complete.c and modified to write in
the TUI command window using tui_putc/tui_puts. */
static void
-tui_rl_display_match_list (matches, len, max)
- char **matches;
- int len, max;
+tui_rl_display_match_list (char **matches, int len, int max)
{
typedef int QSFUNC (const void *, const void *);
extern int _rl_qsort_string_compare (const void*, const void*);
/* Initialize the IO for gdb in curses mode. */
void
-tui_initialize_io ()
+tui_initialize_io (void)
{
#ifdef SIGCONT
signal (SIGCONT, tui_cont_sig);
tui_stderr = tui_fileopen (stderr);
tui_out = tui_out_new (tui_stdout);
- /* Create the default UI. It is not created because we installed
- a init_ui_hook. */
+ /* Create the default UI. It is not created because we installed a
+ deprecated_init_ui_hook. */
tui_old_uiout = uiout = cli_out_new (gdb_stdout);
#ifdef TUI_USE_PIPE_FOR_READLINE
#endif
ch = wgetch (w);
- ch = _tuiHandleResizeDuringIO (ch);
+ ch = tui_handle_resize_during_io (ch);
/* The \n must be echoed because it will not be printed by readline. */
if (ch == '\n')
if (ch == '\n' || ch == '\r' || ch == '\f')
TUI_CMD_WIN->detail.command_info.curch = 0;
-#if 0
- else
- tuiIncrCommandCharCountBy (1);
-#endif
if (ch == KEY_BACKSPACE)
return '\b';
/* Cleanup when a resize has occured.
Returns the character that must be processed. */
static unsigned int
-_tuiHandleResizeDuringIO (unsigned int originalCh)
+tui_handle_resize_during_io (unsigned int original_ch)
{
if (tui_win_resized ())
{
return '\n';
}
else
- return originalCh;
+ return original_ch;
}