binutils-gdb/gdb/cli-out.h

52 lines
1.5 KiB
C
Raw Normal View History

2000-02-03 05:14:45 +01:00
/* Output generating routines for GDB CLI.
Copyright (C) 1999-2015 Free Software Foundation, Inc.
2000-02-03 05:14:45 +01:00
Contributed by Cygnus Solutions.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
2000-02-03 05:14:45 +01:00
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
2000-02-03 05:14:45 +01:00
#ifndef CLI_OUT_H
#define CLI_OUT_H
PR tui/9217 * tui/tui-out.c: Include cli-out.h. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end, tui_field_int, tui_field_skip) (tui_field_string, tui_field_fmt, tui_spaces, tui_text) (tui_message, tui_wrap_hint, tui_flush): Delete forward declarations. (struct ui_out_data): Rename to... (struct tui_ui_out_data): ... this. Remove `stream' and `suppress_output' fields, and inherit cli_ui_out_data. (tui_out_data): New typedef. (tui_ui_out_impl): Don't initialize fields staticaly. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end): Delete. (tui_field_int): Adjust to delegate most work to the base type. (tui_field_skip): Delete. (tui_field_string, tui_field_fmt): Adjust comment. Adjust to delegate most work to the base type. (tui_spaces): Delete. (tui_text): Adjust to delegate most work to the base type. (tui_message): Delete. (tui_wrap_hint): Delete. (tui_flush): Delete. (out_field_fmt): Delete. (field_separator): Delete. (tui_out_new): Adjust to initialize the base type. (_initialize_tui_out): Initialize tui_ui_out_impl. * cli-out.c (struct ui_out_data): Moved out to cli-out.h, renamed cli_ui_out_data. (cli_out_data): Adjust. (cli_ui_out_impl): Make extern. (cli_table_header, cli_field_int, cli_field_skip): Use uo_field_string instead of cli_field_string. (cli_redirect): Adjust to use cli_out_data. (cli_out_data_ctor): New. (cli_out_new): Use it. * cli-out.h (struct ui_file): Remove forward declaration. (struct cli_ui_out_data): New, moved from cli-out.c, and renamed. (cli_ui_out_impl): Declare. (cli_out_data_ctor): Declare. * ui-out.c (struct ui_out) <data>: Change type to void pointer. (uo_field_string): No longer static. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. * ui-out.h (struct ui_out_data): Don't forward declare. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. (uo_field_string): Declare.
2010-04-18 02:11:55 +02:00
#include "ui-out.h"
#include "vec.h"
/* Used for cli_ui_out_data->streams. */
typedef struct ui_file *ui_filep;
DEF_VEC_P (ui_filep);
PR tui/9217 * tui/tui-out.c: Include cli-out.h. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end, tui_field_int, tui_field_skip) (tui_field_string, tui_field_fmt, tui_spaces, tui_text) (tui_message, tui_wrap_hint, tui_flush): Delete forward declarations. (struct ui_out_data): Rename to... (struct tui_ui_out_data): ... this. Remove `stream' and `suppress_output' fields, and inherit cli_ui_out_data. (tui_out_data): New typedef. (tui_ui_out_impl): Don't initialize fields staticaly. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end): Delete. (tui_field_int): Adjust to delegate most work to the base type. (tui_field_skip): Delete. (tui_field_string, tui_field_fmt): Adjust comment. Adjust to delegate most work to the base type. (tui_spaces): Delete. (tui_text): Adjust to delegate most work to the base type. (tui_message): Delete. (tui_wrap_hint): Delete. (tui_flush): Delete. (out_field_fmt): Delete. (field_separator): Delete. (tui_out_new): Adjust to initialize the base type. (_initialize_tui_out): Initialize tui_ui_out_impl. * cli-out.c (struct ui_out_data): Moved out to cli-out.h, renamed cli_ui_out_data. (cli_out_data): Adjust. (cli_ui_out_impl): Make extern. (cli_table_header, cli_field_int, cli_field_skip): Use uo_field_string instead of cli_field_string. (cli_redirect): Adjust to use cli_out_data. (cli_out_data_ctor): New. (cli_out_new): Use it. * cli-out.h (struct ui_file): Remove forward declaration. (struct cli_ui_out_data): New, moved from cli-out.c, and renamed. (cli_ui_out_impl): Declare. (cli_out_data_ctor): Declare. * ui-out.c (struct ui_out) <data>: Change type to void pointer. (uo_field_string): No longer static. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. * ui-out.h (struct ui_out_data): Don't forward declare. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. (uo_field_string): Declare.
2010-04-18 02:11:55 +02:00
/* These are exported so that they can be extended by other `ui_out'
implementations, like TUI's. */
struct cli_ui_out_data
{
VEC (ui_filep) *streams;
PR tui/9217 * tui/tui-out.c: Include cli-out.h. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end, tui_field_int, tui_field_skip) (tui_field_string, tui_field_fmt, tui_spaces, tui_text) (tui_message, tui_wrap_hint, tui_flush): Delete forward declarations. (struct ui_out_data): Rename to... (struct tui_ui_out_data): ... this. Remove `stream' and `suppress_output' fields, and inherit cli_ui_out_data. (tui_out_data): New typedef. (tui_ui_out_impl): Don't initialize fields staticaly. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end): Delete. (tui_field_int): Adjust to delegate most work to the base type. (tui_field_skip): Delete. (tui_field_string, tui_field_fmt): Adjust comment. Adjust to delegate most work to the base type. (tui_spaces): Delete. (tui_text): Adjust to delegate most work to the base type. (tui_message): Delete. (tui_wrap_hint): Delete. (tui_flush): Delete. (out_field_fmt): Delete. (field_separator): Delete. (tui_out_new): Adjust to initialize the base type. (_initialize_tui_out): Initialize tui_ui_out_impl. * cli-out.c (struct ui_out_data): Moved out to cli-out.h, renamed cli_ui_out_data. (cli_out_data): Adjust. (cli_ui_out_impl): Make extern. (cli_table_header, cli_field_int, cli_field_skip): Use uo_field_string instead of cli_field_string. (cli_redirect): Adjust to use cli_out_data. (cli_out_data_ctor): New. (cli_out_new): Use it. * cli-out.h (struct ui_file): Remove forward declaration. (struct cli_ui_out_data): New, moved from cli-out.c, and renamed. (cli_ui_out_impl): Declare. (cli_out_data_ctor): Declare. * ui-out.c (struct ui_out) <data>: Change type to void pointer. (uo_field_string): No longer static. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. * ui-out.h (struct ui_out_data): Don't forward declare. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. (uo_field_string): Declare.
2010-04-18 02:11:55 +02:00
int suppress_output;
};
extern const struct ui_out_impl cli_ui_out_impl;
PR tui/9217 * tui/tui-out.c: Include cli-out.h. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end, tui_field_int, tui_field_skip) (tui_field_string, tui_field_fmt, tui_spaces, tui_text) (tui_message, tui_wrap_hint, tui_flush): Delete forward declarations. (struct ui_out_data): Rename to... (struct tui_ui_out_data): ... this. Remove `stream' and `suppress_output' fields, and inherit cli_ui_out_data. (tui_out_data): New typedef. (tui_ui_out_impl): Don't initialize fields staticaly. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end): Delete. (tui_field_int): Adjust to delegate most work to the base type. (tui_field_skip): Delete. (tui_field_string, tui_field_fmt): Adjust comment. Adjust to delegate most work to the base type. (tui_spaces): Delete. (tui_text): Adjust to delegate most work to the base type. (tui_message): Delete. (tui_wrap_hint): Delete. (tui_flush): Delete. (out_field_fmt): Delete. (field_separator): Delete. (tui_out_new): Adjust to initialize the base type. (_initialize_tui_out): Initialize tui_ui_out_impl. * cli-out.c (struct ui_out_data): Moved out to cli-out.h, renamed cli_ui_out_data. (cli_out_data): Adjust. (cli_ui_out_impl): Make extern. (cli_table_header, cli_field_int, cli_field_skip): Use uo_field_string instead of cli_field_string. (cli_redirect): Adjust to use cli_out_data. (cli_out_data_ctor): New. (cli_out_new): Use it. * cli-out.h (struct ui_file): Remove forward declaration. (struct cli_ui_out_data): New, moved from cli-out.c, and renamed. (cli_ui_out_impl): Declare. (cli_out_data_ctor): Declare. * ui-out.c (struct ui_out) <data>: Change type to void pointer. (uo_field_string): No longer static. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. * ui-out.h (struct ui_out_data): Don't forward declare. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. (uo_field_string): Declare.
2010-04-18 02:11:55 +02:00
2000-02-03 05:14:45 +01:00
extern struct ui_out *cli_out_new (struct ui_file *stream);
PR tui/9217 * tui/tui-out.c: Include cli-out.h. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end, tui_field_int, tui_field_skip) (tui_field_string, tui_field_fmt, tui_spaces, tui_text) (tui_message, tui_wrap_hint, tui_flush): Delete forward declarations. (struct ui_out_data): Rename to... (struct tui_ui_out_data): ... this. Remove `stream' and `suppress_output' fields, and inherit cli_ui_out_data. (tui_out_data): New typedef. (tui_ui_out_impl): Don't initialize fields staticaly. (tui_table_begin, tui_table_body, tui_table_end, tui_table_header) (tui_begin, tui_end): Delete. (tui_field_int): Adjust to delegate most work to the base type. (tui_field_skip): Delete. (tui_field_string, tui_field_fmt): Adjust comment. Adjust to delegate most work to the base type. (tui_spaces): Delete. (tui_text): Adjust to delegate most work to the base type. (tui_message): Delete. (tui_wrap_hint): Delete. (tui_flush): Delete. (out_field_fmt): Delete. (field_separator): Delete. (tui_out_new): Adjust to initialize the base type. (_initialize_tui_out): Initialize tui_ui_out_impl. * cli-out.c (struct ui_out_data): Moved out to cli-out.h, renamed cli_ui_out_data. (cli_out_data): Adjust. (cli_ui_out_impl): Make extern. (cli_table_header, cli_field_int, cli_field_skip): Use uo_field_string instead of cli_field_string. (cli_redirect): Adjust to use cli_out_data. (cli_out_data_ctor): New. (cli_out_new): Use it. * cli-out.h (struct ui_file): Remove forward declaration. (struct cli_ui_out_data): New, moved from cli-out.c, and renamed. (cli_ui_out_impl): Declare. (cli_out_data_ctor): Declare. * ui-out.c (struct ui_out) <data>: Change type to void pointer. (uo_field_string): No longer static. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. * ui-out.h (struct ui_out_data): Don't forward declare. (ui_out_data): Change return type to void pointer. (ui_out_new): Change `data' parameter type to void pointer. (uo_field_string): Declare.
2010-04-18 02:11:55 +02:00
extern void cli_out_data_ctor (struct cli_ui_out_data *data,
struct ui_file *stream);
extern struct ui_file *cli_out_set_stream (struct ui_out *uiout,
struct ui_file *stream);
2000-02-03 05:14:45 +01:00
#endif