This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Re-org mi/mi-out.c so that it is (almost) tupple aware
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch] Re-org mi/mi-out.c so that it is (almost) tupple aware
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 10 May 2001 18:30:23 -0400
FYI,
The attached patch tweeks mi/mi-out.c so that it has the tupple/list
parameter available where needed. It doesn't actually use it yet.
Andrew
2001-05-10 Andrew Cagney <ac131313@redhat.com>
* mi-out.c (mi_open, mi_close): Replace list_open and list_close.
(mi_table_begin): Update.
(mi_table_header): Update.
(mi_begin): Update.
(mi_table_body): Update.
(mi_table_end): Update.
(mi_end): Update.
Index: mi/mi-out.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-out.c,v
retrieving revision 1.7
diff -p -r1.7 mi-out.c
*** mi-out.c 2001/05/09 01:33:10 1.7
--- mi-out.c 2001/05/10 22:26:51
*************** struct ui_out_impl mi_ui_out_impl =
*** 91,98 ****
extern void _initialize_mi_out (void);
static void field_separator (struct ui_out *uiout);
! static void list_open (struct ui_out *uiout);
! static void list_close (struct ui_out *uiout);
static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
char *format,...);
--- 91,98 ----
extern void _initialize_mi_out (void);
static void field_separator (struct ui_out *uiout);
! static void mi_open (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,
char *format,...);
*************** mi_table_begin (struct ui_out *uiout, in
*** 106,112 ****
field_separator (uiout);
if (tblid)
fprintf_unfiltered (data->buffer, "%s=", tblid);
! list_open (uiout);
data->first_header = 0;
data->supress_field_separator = 1;
}
--- 106,112 ----
field_separator (uiout);
if (tblid)
fprintf_unfiltered (data->buffer, "%s=", tblid);
! mi_open (uiout, ui_out_type_tupple);
data->first_header = 0;
data->supress_field_separator = 1;
}
*************** mi_table_body (struct ui_out *uiout)
*** 119,125 ****
struct ui_out_data *data = ui_out_data (uiout);
/* close the table header line if there were any headers */
if (data->first_header)
! list_close (uiout);
}
/* Mark end of a table */
--- 119,125 ----
struct ui_out_data *data = ui_out_data (uiout);
/* close the table header line if there were any headers */
if (data->first_header)
! mi_close (uiout, ui_out_type_tupple);
}
/* Mark end of a table */
*************** void
*** 128,134 ****
mi_table_end (struct ui_out *uiout)
{
struct ui_out_data *data = ui_out_data (uiout);
! list_close (uiout);
/* If table was empty this flag did not get reset yet */
data->supress_field_separator = 0;
}
--- 128,134 ----
mi_table_end (struct ui_out *uiout)
{
struct ui_out_data *data = ui_out_data (uiout);
! mi_close (uiout, ui_out_type_tupple);
/* If table was empty this flag did not get reset yet */
data->supress_field_separator = 0;
}
*************** mi_table_header (struct ui_out *uiout, i
*** 142,148 ****
if (!data->first_header++)
{
fputs_unfiltered ("hdr=", data->buffer);
! list_open (uiout);
}
mi_field_string (uiout, 0, width, alignment, 0, colhdr);
}
--- 142,148 ----
if (!data->first_header++)
{
fputs_unfiltered ("hdr=", data->buffer);
! mi_open (uiout, ui_out_type_tupple);
}
mi_field_string (uiout, 0, width, alignment, 0, colhdr);
}
*************** void
*** 153,166 ****
mi_begin (struct ui_out *uiout,
enum ui_out_type type,
int level,
! const char *lstid)
{
struct ui_out_data *data = ui_out_data (uiout);
field_separator (uiout);
data->supress_field_separator = 1;
! if (lstid)
! fprintf_unfiltered (data->buffer, "%s=", lstid);
! list_open (uiout);
}
/* Mark end of a list */
--- 153,166 ----
mi_begin (struct ui_out *uiout,
enum ui_out_type type,
int level,
! const char *id)
{
struct ui_out_data *data = ui_out_data (uiout);
field_separator (uiout);
data->supress_field_separator = 1;
! if (id)
! fprintf_unfiltered (data->buffer, "%s=", id);
! mi_open (uiout, type);
}
/* Mark end of a list */
*************** mi_end (struct ui_out *uiout,
*** 171,177 ****
int level)
{
struct ui_out_data *data = ui_out_data (uiout);
! list_close (uiout);
/* If list was empty this flag did not get reset yet */
data->supress_field_separator = 0;
}
--- 171,177 ----
int level)
{
struct ui_out_data *data = ui_out_data (uiout);
! mi_close (uiout, type);
/* If list was empty this flag did not get reset yet */
data->supress_field_separator = 0;
}
*************** field_separator (struct ui_out *uiout)
*** 303,316 ****
}
static void
! list_open (struct ui_out *uiout)
{
struct ui_out_data *data = ui_out_data (uiout);
fputc_unfiltered ('{', data->buffer);
}
static void
! list_close (struct ui_out *uiout)
{
struct ui_out_data *data = ui_out_data (uiout);
fputc_unfiltered ('}', data->buffer);
--- 303,318 ----
}
static void
! mi_open (struct ui_out *uiout,
! enum ui_out_type type)
{
struct ui_out_data *data = ui_out_data (uiout);
fputc_unfiltered ('{', data->buffer);
}
static void
! mi_close (struct ui_out *uiout,
! enum ui_out_type type)
{
struct ui_out_data *data = ui_out_data (uiout);
fputc_unfiltered ('}', data->buffer);