static void mi_open (struct ui_out *uiout, const char *name, enum ui_out_type type) { struct ui_out_data *data = ui_out_data (uiout); field_separator (uiout); data->suppress_field_separator = 1; if (name) fprintf_unfiltered (data->buffer, "%s=", name); switch (type) { case ui_out_type_tuple: fputc_unfiltered ('{', data->buffer); break; case ui_out_type_list: if (data->mi_version == 0) fputc_unfiltered ('{', data->buffer); else fputc_unfiltered ('[', data->buffer); break; default: internal_error (__FILE__, __LINE__, "bad switch"); } }
static void cli_flush (struct ui_out *uiout) { cli_out_data *data = ui_out_data (uiout); gdb_flush (data->stream); }
static void tui_field_string (struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, const char *string) { tui_out_data *data = (tui_out_data *) ui_out_data (uiout); if (data->base.suppress_output) return; if (fldname && data->line > 0 && strcmp (fldname, "fullname") == 0) { data->start_of_line ++; if (data->line > 0) { tui_show_source (string, data->line); } return; } data->start_of_line++; (*cli_ui_out_impl.field_string) (uiout, fldno, width, align, fldname, string); }
static void cli_table_end (struct ui_out *uiout) { cli_out_data *data = ui_out_data (uiout); data->suppress_output = 0; }
static void cli_uiout_dtor (struct ui_out *ui_out) { cli_out_data *data = (cli_out_data *) ui_out_data (ui_out); delete data; }
static void field_separator (void) { cli_out_data *data = ui_out_data (uiout); fputc_filtered (' ', data->stream); }
void tui_field_string (struct ui_out *uiout, int fldno, int width, enum ui_align align, const char *fldname, const char *string) { int before = 0; int after = 0; tui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; if (fldname && data->line > 0 && strcmp (fldname, "file") == 0) { data->start_of_line ++; if (data->line > 0) { tui_show_source (string, data->line); } return; } data->start_of_line ++; if ((align != ui_noalign) && string) { before = width - strlen (string); if (before <= 0) before = 0; else { if (align == ui_right) after = 0; else if (align == ui_left) { after = before; before = 0; } else /* ui_center */ { after = before / 2; before -= after; } } } if (before) ui_out_spaces (uiout, before); if (string) out_field_fmt (uiout, fldno, fldname, "%s", string); if (after) ui_out_spaces (uiout, after); if (align != ui_noalign) field_separator (); }
void mi_table_end (struct ui_out *uiout) { mi_out_data *data = ui_out_data (uiout); data->suppress_output = 0; mi_close (uiout, ui_out_type_list); /* body */ mi_close (uiout, ui_out_type_tuple); }
struct ui_file * cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream) { cli_out_data *data = ui_out_data (uiout); struct ui_file *old = data->stream; data->stream = stream; return old; }
static void field_separator (void) { cli_out_data *data = (cli_out_data *) ui_out_data (current_uiout); struct ui_file *stream = data->streams.back (); fputc_filtered (' ', stream); }
static void cli_flush (struct ui_out *uiout) { cli_out_data *data = (cli_out_data *) ui_out_data (uiout); struct ui_file *stream = data->streams.back (); gdb_flush (stream); }
void mi_out_put (struct ui_out *uiout, struct ui_file *stream) { struct ui_out_data *data = ui_out_data (uiout); ui_file_put (data->buffer, do_write, stream); ui_file_rewind (data->buffer); }
void cli_wrap_hint (struct ui_out *uiout, char *identstring) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; wrap_here (identstring); }
void cli_spaces (struct ui_out *uiout, int numspaces) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; print_spaces_filtered (numspaces, data->stream); }
void cli_text (struct ui_out *uiout, const char *string) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; fputs_filtered (string, data->stream); }
static void field_separator (void) { cli_out_data *data = ui_out_data (current_uiout); struct ui_file *stream = VEC_last (ui_filep, data->streams); fputc_filtered (' ', stream); }
static void cli_uiout_dtor (struct ui_out *ui_out) { cli_out_data *data = ui_out_data (ui_out); VEC_free (ui_filep, data->streams); xfree (data); }
static void cli_flush (struct ui_out *uiout) { cli_out_data *data = ui_out_data (uiout); struct ui_file *stream = VEC_last (ui_filep, data->streams); gdb_flush (stream); }
void cli_end (struct ui_out *uiout, enum ui_out_type type, int level) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; }
void cli_table_body (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; /* first, close the table header line */ cli_text (uiout, "\n"); }
static void field_separator (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_field_separator) data->suppress_field_separator = 0; else fputc_unfiltered (',', data->buffer); }
static void cli_end (struct ui_out *uiout, enum ui_out_type type) { cli_out_data *data = (cli_out_data *) ui_out_data (uiout); if (data->suppress_output) return; }
void mi_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align alignment, const char *fldname) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; mi_field_string (uiout, fldno, width, alignment, fldname, ""); }
void cli_begin (struct ui_out *uiout, enum ui_out_type type, int level, const char *id) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; }
void cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment, const char *col_name, const char *colhdr) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; cli_field_string (uiout, 0, width, alignment, 0, colhdr); }
void mi_table_body (struct ui_out *uiout) { mi_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; /* close the table header line if there were any headers */ mi_close (uiout, ui_out_type_list); mi_open (uiout, "body", ui_out_type_list); }
void mi_end (struct ui_out *uiout, enum ui_out_type type, int level) { mi_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; mi_close (uiout, type); }
void cli_message (struct ui_out *uiout, int verbosity, const char *format, va_list args) { struct ui_out_data *data = ui_out_data (uiout); if (data->suppress_output) return; if (ui_out_get_verblvl (uiout) >= verbosity) vfprintf_unfiltered (data->stream, format, args); }
static void cli_begin (struct ui_out *uiout, enum ui_out_type type, const char *id) { cli_out_data *data = (cli_out_data *) ui_out_data (uiout); if (data->suppress_output) return; }
cli_message (struct ui_out *uiout, const char *format, va_list args) { cli_out_data *data = (cli_out_data *) ui_out_data (uiout); if (data->suppress_output) return; struct ui_file *stream = data->streams.back (); vfprintf_unfiltered (stream, format, args); }