static enum tui_status tui_adjust_win_heights (struct tui_win_info *,
int);
static int new_height_ok (struct tui_win_info *, int);
-static void tui_set_tab_width_command (char *, int);
-static void tui_refresh_all_command (char *, int);
-static void tui_set_win_height_command (char *, int);
-static void tui_all_windows_info (char *, int);
-static void tui_set_focus_command (char *, int);
-static void tui_scroll_forward_command (char *, int);
-static void tui_scroll_backward_command (char *, int);
-static void tui_scroll_left_command (char *, int);
-static void tui_scroll_right_command (char *, int);
-static void parse_scrolling_args (char *,
+static void tui_set_tab_width_command (const char *, int);
+static void tui_refresh_all_command (const char *, int);
+static void tui_set_win_height_command (const char *, int);
+static void tui_all_windows_info (const char *, int);
+static void tui_set_focus_command (const char *, int);
+static void tui_scroll_forward_command (const char *, int);
+static void tui_scroll_backward_command (const char *, int);
+static void tui_scroll_left_command (const char *, int);
+static void tui_scroll_right_command (const char *, int);
+static void parse_scrolling_args (const char *,
struct tui_win_info **,
int *);
}
static void
-set_tui_cmd (char *args, int from_tty)
+set_tui_cmd (const char *args, int from_tty)
{
}
static void
-show_tui_cmd (char *args, int from_tty)
+show_tui_cmd (const char *args, int from_tty)
{
}
static struct cmd_list_element *tuilist;
static void
-tui_command (char *args, int from_tty)
+tui_command (const char *args, int from_tty)
{
printf_unfiltered (_("\"tui\" must be followed by the name of a "
"tui command.\n"));
/* The set_func hook of "set tui ..." commands that affect the window
borders on the TUI display. */
void
-tui_set_var_cmd (char *null_args, int from_tty, struct cmd_list_element *c)
+tui_set_var_cmd (const char *null_args,
+ int from_tty, struct cmd_list_element *c)
{
if (tui_update_variables () && tui_active)
tui_rehighlight_all ();
static void
-tui_scroll_forward_command (char *arg, int from_tty)
+tui_scroll_forward_command (const char *arg, int from_tty)
{
int num_to_scroll = 1;
struct tui_win_info *win_to_scroll;
static void
-tui_scroll_backward_command (char *arg, int from_tty)
+tui_scroll_backward_command (const char *arg, int from_tty)
{
int num_to_scroll = 1;
struct tui_win_info *win_to_scroll;
static void
-tui_scroll_left_command (char *arg, int from_tty)
+tui_scroll_left_command (const char *arg, int from_tty)
{
int num_to_scroll;
struct tui_win_info *win_to_scroll;
static void
-tui_scroll_right_command (char *arg, int from_tty)
+tui_scroll_right_command (const char *arg, int from_tty)
{
int num_to_scroll;
struct tui_win_info *win_to_scroll;
/* Set focus to the window named by 'arg'. */
static void
-tui_set_focus (char *arg, int from_tty)
+tui_set_focus (const char *arg, int from_tty)
{
if (arg != (char *) NULL)
{
}
static void
-tui_set_focus_command (char *arg, int from_tty)
+tui_set_focus_command (const char *arg, int from_tty)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
static void
-tui_all_windows_info (char *arg, int from_tty)
+tui_all_windows_info (const char *arg, int from_tty)
{
int type;
struct tui_win_info *win_with_focus = tui_win_with_focus ();
static void
-tui_refresh_all_command (char *arg, int from_tty)
+tui_refresh_all_command (const char *arg, int from_tty)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
/* Set the tab width of the specified window. */
static void
-tui_set_tab_width_command (char *arg, int from_tty)
+tui_set_tab_width_command (const char *arg, int from_tty)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
/* Set the height of the specified window. */
static void
-tui_set_win_height (char *arg, int from_tty)
+tui_set_win_height (const char *arg, int from_tty)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
if (arg != (char *) NULL)
{
- char *buf = xstrdup (arg);
+ std::string copy = arg;
+ char *buf = ©[0];
char *buf_ptr = buf;
char *wname = NULL;
int new_height, i;
struct tui_win_info *win_info;
- struct cleanup *old_chain;
- old_chain = make_cleanup (xfree, buf);
wname = buf_ptr;
buf_ptr = strchr (buf_ptr, ' ');
if (buf_ptr != (char *) NULL)
}
else
printf_filtered (WIN_HEIGHT_USAGE);
-
- do_cleanups (old_chain);
}
else
printf_filtered (WIN_HEIGHT_USAGE);
/* Set the height of the specified window, with va_list. */
static void
-tui_set_win_height_command (char *arg, int from_tty)
+tui_set_win_height_command (const char *arg, int from_tty)
{
/* Make sure the curses mode is enabled. */
tui_enable ();
static void
-parse_scrolling_args (char *arg,
+parse_scrolling_args (const char *arg,
struct tui_win_info **win_to_scroll,
int *num_to_scroll)
{
window name arg. */
if (arg != (char *) NULL)
{
- char *buf, *buf_ptr;
- struct cleanup *old_chain;
+ char *buf_ptr;
/* Process the number of lines to scroll. */
- buf = buf_ptr = xstrdup (arg);
- old_chain = make_cleanup (xfree, buf);
+ std::string copy = arg;
+ buf_ptr = ©[0];
if (isdigit (*buf_ptr))
{
char *num_str;
else if (*win_to_scroll == TUI_CMD_WIN)
*win_to_scroll = (tui_source_windows ())->list[0];
}
- do_cleanups (old_chain);
}
}