mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
Move supress_field_separator logic into mi_open() and mi_close().
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
2001-06-09 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
|
* mi-out.c (mi_table_end, mi_table_begin, mi_begin, mi_end): Move
|
||||||
|
supress_field_separator updates from here.
|
||||||
|
(mi_open, mi_close): To here.
|
||||||
|
(mi_open): Add parameter name. Output a field_separator.
|
||||||
|
(mi_table_begin): Update.
|
||||||
|
(mi_table_header):
|
||||||
|
(mi_begin): Update.
|
||||||
|
|
||||||
2001-06-09 Andrew Cagney <ac131313@redhat.com>
|
2001-06-09 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
* mi-out.c (mi_table_begin): Make char* parameters constant.
|
* mi-out.c (mi_table_begin): Make char* parameters constant.
|
||||||
|
@ -94,7 +94,8 @@ struct ui_out_impl mi_ui_out_impl =
|
|||||||
|
|
||||||
extern void _initialize_mi_out (void);
|
extern void _initialize_mi_out (void);
|
||||||
static void field_separator (struct ui_out *uiout);
|
static void field_separator (struct ui_out *uiout);
|
||||||
static void mi_open (struct ui_out *uiout, enum ui_out_type type);
|
static void mi_open (struct ui_out *uiout, const char *name,
|
||||||
|
enum ui_out_type type);
|
||||||
static void mi_close (struct ui_out *uiout, enum ui_out_type type);
|
static void mi_close (struct ui_out *uiout, enum ui_out_type type);
|
||||||
|
|
||||||
static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
|
static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
|
||||||
@ -107,12 +108,8 @@ mi_table_begin (struct ui_out *uiout, int nbrofcols,
|
|||||||
const char *tblid)
|
const char *tblid)
|
||||||
{
|
{
|
||||||
struct ui_out_data *data = ui_out_data (uiout);
|
struct ui_out_data *data = ui_out_data (uiout);
|
||||||
field_separator (uiout);
|
mi_open (uiout, tblid, ui_out_type_tuple);
|
||||||
if (tblid)
|
|
||||||
fprintf_unfiltered (data->buffer, "%s=", tblid);
|
|
||||||
mi_open (uiout, ui_out_type_tuple);
|
|
||||||
data->first_header = 0;
|
data->first_header = 0;
|
||||||
data->supress_field_separator = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark beginning of a table body */
|
/* Mark beginning of a table body */
|
||||||
@ -133,8 +130,6 @@ mi_table_end (struct ui_out *uiout)
|
|||||||
{
|
{
|
||||||
struct ui_out_data *data = ui_out_data (uiout);
|
struct ui_out_data *data = ui_out_data (uiout);
|
||||||
mi_close (uiout, ui_out_type_tuple);
|
mi_close (uiout, ui_out_type_tuple);
|
||||||
/* If table was empty this flag did not get reset yet */
|
|
||||||
data->supress_field_separator = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Specify table header */
|
/* Specify table header */
|
||||||
@ -146,8 +141,7 @@ mi_table_header (struct ui_out *uiout, int width, int alignment,
|
|||||||
struct ui_out_data *data = ui_out_data (uiout);
|
struct ui_out_data *data = ui_out_data (uiout);
|
||||||
if (!data->first_header++)
|
if (!data->first_header++)
|
||||||
{
|
{
|
||||||
fputs_unfiltered ("hdr=", data->buffer);
|
mi_open (uiout, "hdr", ui_out_type_tuple);
|
||||||
mi_open (uiout, ui_out_type_tuple);
|
|
||||||
}
|
}
|
||||||
mi_field_string (uiout, 0, width, alignment, 0, colhdr);
|
mi_field_string (uiout, 0, width, alignment, 0, colhdr);
|
||||||
}
|
}
|
||||||
@ -161,11 +155,7 @@ mi_begin (struct ui_out *uiout,
|
|||||||
const char *id)
|
const char *id)
|
||||||
{
|
{
|
||||||
struct ui_out_data *data = ui_out_data (uiout);
|
struct ui_out_data *data = ui_out_data (uiout);
|
||||||
field_separator (uiout);
|
mi_open (uiout, id, type);
|
||||||
data->supress_field_separator = 1;
|
|
||||||
if (id)
|
|
||||||
fprintf_unfiltered (data->buffer, "%s=", id);
|
|
||||||
mi_open (uiout, type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark end of a list */
|
/* Mark end of a list */
|
||||||
@ -177,8 +167,6 @@ mi_end (struct ui_out *uiout,
|
|||||||
{
|
{
|
||||||
struct ui_out_data *data = ui_out_data (uiout);
|
struct ui_out_data *data = ui_out_data (uiout);
|
||||||
mi_close (uiout, type);
|
mi_close (uiout, type);
|
||||||
/* If list was empty this flag did not get reset yet */
|
|
||||||
data->supress_field_separator = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* output an int field */
|
/* output an int field */
|
||||||
@ -313,9 +301,14 @@ field_separator (struct ui_out *uiout)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
mi_open (struct ui_out *uiout,
|
mi_open (struct ui_out *uiout,
|
||||||
|
const char *name,
|
||||||
enum ui_out_type type)
|
enum ui_out_type type)
|
||||||
{
|
{
|
||||||
struct ui_out_data *data = ui_out_data (uiout);
|
struct ui_out_data *data = ui_out_data (uiout);
|
||||||
|
field_separator (uiout);
|
||||||
|
data->supress_field_separator = 1;
|
||||||
|
if (name)
|
||||||
|
fprintf_unfiltered (data->buffer, "%s=", name);
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case ui_out_type_tuple:
|
case ui_out_type_tuple:
|
||||||
@ -345,6 +338,7 @@ mi_close (struct ui_out *uiout,
|
|||||||
default:
|
default:
|
||||||
internal_error (__FILE__, __LINE__, "bad switch");
|
internal_error (__FILE__, __LINE__, "bad switch");
|
||||||
}
|
}
|
||||||
|
data->supress_field_separator = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add a string to the buffer */
|
/* add a string to the buffer */
|
||||||
|
Reference in New Issue
Block a user