2010-05-05 Michael Snyder <msnyder@vmware.com>
[deliverable/binutils-gdb.git] / gdb / mi / mi-out.c
index 2aac5289829ae6ed05d6bab5e1b89fc67b104726..1e941758cc5d1f58be7bfe54fa7687b260cf6d8b 100644 (file)
@@ -1,6 +1,7 @@
 /* MI Command Set - output generating routines.
 
-   Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions (a Red Hat company).
 
@@ -8,7 +9,7 @@
 
    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 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,9 +18,7 @@
    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, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "ui-out.h"
@@ -56,11 +55,12 @@ static void mi_field_string (struct ui_out *uiout, int fldno, int width,
 static void mi_field_fmt (struct ui_out *uiout, int fldno,
                          int width, enum ui_align align,
                          const char *fldname, const char *format,
-                         va_list args);
+                         va_list args) ATTRIBUTE_PRINTF (6, 0);
 static void mi_spaces (struct ui_out *uiout, int numspaces);
 static void mi_text (struct ui_out *uiout, const char *string);
 static void mi_message (struct ui_out *uiout, int verbosity,
-                       const char *format, va_list args);
+                       const char *format, va_list args)
+     ATTRIBUTE_PRINTF (3, 0);
 static void mi_wrap_hint (struct ui_out *uiout, char *identstring);
 static void mi_flush (struct ui_out *uiout);
 
@@ -86,6 +86,7 @@ struct ui_out_impl mi_ui_out_impl =
   mi_message,
   mi_wrap_hint,
   mi_flush,
+  NULL,
   1, /* Needs MI hacks.  */
 };
 
@@ -97,9 +98,6 @@ 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 out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
-                          char *format,...);
-
 /* Mark beginning of a table */
 
 void
@@ -108,7 +106,6 @@ mi_table_begin (struct ui_out *uiout,
                int nr_rows,
                const char *tblid)
 {
-  mi_out_data *data = ui_out_data (uiout);
   mi_open (uiout, tblid, ui_out_type_tuple);
   mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
                "nr_rows", nr_rows);
@@ -289,31 +286,6 @@ mi_flush (struct ui_out *uiout)
 
 /* local functions */
 
-/* Like mi_field_fmt, but takes a variable number of args
-   and makes a va_list and does not insert a separator */
-
-/* VARARGS */
-static void
-out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
-              char *format,...)
-{
-  mi_out_data *data = ui_out_data (uiout);
-  va_list args;
-
-  field_separator (uiout);
-  if (fldname)
-    fprintf_unfiltered (data->buffer, "%s=\"", fldname);
-  else
-    fputs_unfiltered ("\"", data->buffer);
-
-  va_start (args, format);
-  vfprintf_unfiltered (data->buffer, format, args);
-
-  fputs_unfiltered ("\"", data->buffer);
-
-  va_end (args);
-}
-
 /* access to ui_out format private members */
 
 static void
@@ -345,7 +317,7 @@ mi_open (struct ui_out *uiout,
       fputc_unfiltered ('[', data->buffer);
       break;
     default:
-      internal_error (__FILE__, __LINE__, "bad switch");
+      internal_error (__FILE__, __LINE__, _("bad switch"));
     }
 }
 
@@ -363,7 +335,7 @@ mi_close (struct ui_out *uiout,
       fputc_unfiltered (']', data->buffer);
       break;
     default:
-      internal_error (__FILE__, __LINE__, "bad switch");
+      internal_error (__FILE__, __LINE__, _("bad switch"));
     }
   data->suppress_field_separator = 0;
 }
This page took 0.025606 seconds and 4 git commands to generate.