]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/tui/tui-out.c
Switch the license of all .c files to GPLv3.
[thirdparty/binutils-gdb.git] / gdb / tui / tui-out.c
index df6091e7b94d45886859ec29502b47460fa934fe..9e534c6da831ebfba8a4a0943ede7f24c2f5b21e 100644 (file)
@@ -10,7 +10,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,
@@ -19,9 +19,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., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "ui-out.h"
@@ -38,44 +36,56 @@ struct ui_out_data
   };
 typedef struct ui_out_data tui_out_data;
 
-/* These are the CLI output functions */
+/* These are the CLI output functions */
 
-static void tui_table_begin (struct ui_out *uiout, int nbrofcols,
-                            int nr_rows, const char *tblid);
+static void tui_table_begin (struct ui_out *uiout, 
+                            int nbrofcols, int nr_rows, 
+                            const char *tblid);
 static void tui_table_body (struct ui_out *uiout);
 static void tui_table_end (struct ui_out *uiout);
-static void tui_table_header (struct ui_out *uiout, int width,
-                             enum ui_align alig, const char *col_name,
+static void tui_table_header (struct ui_out *uiout, 
+                             int width, enum ui_align alig, 
+                             const char *col_name,
                              const char *colhdr);
-static void tui_begin (struct ui_out *uiout, enum ui_out_type type,
+static void tui_begin (struct ui_out *uiout, 
+                      enum ui_out_type type,
                       int level, const char *lstid);
-static void tui_end (struct ui_out *uiout, enum ui_out_type type, int level);
-static void tui_field_int (struct ui_out *uiout, int fldno, int width,
-                          enum ui_align alig, const char *fldname, int value);
-static void tui_field_skip (struct ui_out *uiout, int fldno, int width,
-                           enum ui_align alig, const char *fldname);
-static void tui_field_string (struct ui_out *uiout, int fldno, int width,
-                             enum ui_align alig, const char *fldname,
+static void tui_end (struct ui_out *uiout, 
+                    enum ui_out_type type, int level);
+static void tui_field_int (struct ui_out *uiout, 
+                          int fldno, int width,
+                          enum ui_align alig, 
+                          const char *fldname, int value);
+static void tui_field_skip (struct ui_out *uiout, 
+                           int fldno, int width,
+                           enum ui_align alig, 
+                           const char *fldname);
+static void tui_field_string (struct ui_out *uiout, 
+                             int fldno, int width,
+                             enum ui_align alig, 
+                             const char *fldname,
                              const char *string);
 static void tui_field_fmt (struct ui_out *uiout, int fldno,
                           int width, enum ui_align align,
-                          const char *fldname, const char *format,
-                          va_list args) ATTR_FORMAT (printf, 6, 0);
+                          const char *fldname, 
+                          const char *format,
+                          va_list args) 
+     ATTR_FORMAT (printf, 6, 0);
 static void tui_spaces (struct ui_out *uiout, int numspaces);
 static void tui_text (struct ui_out *uiout, const char *string);
 static void tui_message (struct ui_out *uiout, int verbosity,
                         const char *format, va_list args)
      ATTR_FORMAT (printf, 3, 0);
-static void tui_wrap_hint (struct ui_out *uiout, char *identstring);
+static void tui_wrap_hint (struct ui_out *uiout, 
+                          char *identstring);
 static void tui_flush (struct ui_out *uiout);
 
-/* This is the CLI ui-out implementation functions vector */
+/* This is the CLI ui-out implementation functions vector */
 
 /* FIXME: This can be initialized dynamically after default is set to
-   handle initial output in main.c */
+   handle initial output in main.c */
 
-static struct ui_out_impl tui_ui_out_impl =
-{
+static struct ui_out_impl tui_ui_out_impl = {
   tui_table_begin,
   tui_table_body,
   tui_table_end,
@@ -95,24 +105,27 @@ static struct ui_out_impl tui_ui_out_impl =
   0, /* Does not need MI hacks (i.e. needs CLI hacks).  */
 };
 
-/* Prototypes for local functions */
+/* Prototypes for local functions */
 
 extern void _initialize_tui_out (void);
 
 static void field_separator (void);
 
-static void out_field_fmt (struct ui_out *uiout, int fldno,
+static void out_field_fmt (struct ui_out *uiout, 
+                          int fldno,
                           const char *fldname,
-                          const char *format,...) ATTR_FORMAT (printf, 4, 5);
+                          const char *format,...) 
+     ATTR_FORMAT (printf, 4, 5);
 
 /* local variables */
 
 /* (none yet) */
 
-/* Mark beginning of a table */
+/* Mark beginning of a table */
 
 void
-tui_table_begin (struct ui_out *uiout, int nbrofcols,
+tui_table_begin (struct ui_out *uiout, 
+                int nbrofcols,
                 int nr_rows,
                 const char *tblid)
 {
@@ -121,11 +134,11 @@ tui_table_begin (struct ui_out *uiout, int nbrofcols,
     data->suppress_output = 1;
   else
     /* Only the table suppresses the output and, fortunately, a table
-       is not a recursive data structure. */
+       is not a recursive data structure.  */
     gdb_assert (data->suppress_output == 0);
 }
 
-/* Mark beginning of a table body */
+/* Mark beginning of a table body */
 
 void
 tui_table_body (struct ui_out *uiout)
@@ -133,11 +146,11 @@ tui_table_body (struct ui_out *uiout)
   tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
-  /* first, close the table header line */
+  /* First, close the table header line.  */
   tui_text (uiout, "\n");
 }
 
-/* Mark end of a table */
+/* Mark end of a table */
 
 void
 tui_table_end (struct ui_out *uiout)
@@ -146,10 +159,12 @@ tui_table_end (struct ui_out *uiout)
   data->suppress_output = 0;
 }
 
-/* Specify table header */
+/* Specify table header */
 
 void
-tui_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+tui_table_header (struct ui_out *uiout, 
+                 int width, 
+                 enum ui_align alignment,
                  const char *col_name,
                  const char *colhdr)
 {
@@ -159,7 +174,7 @@ tui_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
   tui_field_string (uiout, 0, width, alignment, 0, colhdr);
 }
 
-/* Mark beginning of a list */
+/* Mark beginning of a list */
 
 void
 tui_begin (struct ui_out *uiout,
@@ -172,7 +187,7 @@ tui_begin (struct ui_out *uiout,
     return;
 }
 
-/* Mark end of a list */
+/* Mark end of a list */
 
 void
 tui_end (struct ui_out *uiout,
@@ -184,14 +199,16 @@ tui_end (struct ui_out *uiout,
     return;
 }
 
-/* output an int field */
+/* Output an int field.  */
 
 void
-tui_field_int (struct ui_out *uiout, int fldno, int width,
+tui_field_int (struct ui_out *uiout, 
+              int fldno, int width,
               enum ui_align alignment,
-              const char *fldname, int value)
+              const char *fldname, 
+              int value)
 {
-  char buffer[20];             /* FIXME: how many chars long a %d can become? */
+  char buffer[20];     /* FIXME: how many chars long a %d can become?  */
 
   tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
@@ -209,10 +226,11 @@ tui_field_int (struct ui_out *uiout, int fldno, int width,
   tui_field_string (uiout, fldno, width, alignment, fldname, buffer);
 }
 
-/* used to ommit a field */
+/* Used to ommit a field.  */
 
 void
-tui_field_skip (struct ui_out *uiout, int fldno, int width,
+tui_field_skip (struct ui_out *uiout, 
+               int fldno, int width,
                enum ui_align alignment,
                const char *fldname)
 {
@@ -222,13 +240,12 @@ tui_field_skip (struct ui_out *uiout, int fldno, int width,
   tui_field_string (uiout, fldno, width, alignment, fldname, "");
 }
 
-/* other specific tui_field_* end up here so alignment and field
-   separators are both handled by tui_field_string */
+/* Other specific tui_field_* end up here so alignment and field
+   separators are both handled by tui_field_string */
 
 void
 tui_field_string (struct ui_out *uiout,
-                 int fldno,
-                 int width,
+                 int fldno, int width,
                  enum ui_align align,
                  const char *fldname,
                  const char *string)
@@ -285,7 +302,7 @@ tui_field_string (struct ui_out *uiout,
     field_separator ();
 }
 
-/* This is the only field function that does not align */
+/* This is the only field function that does not align */
 
 void
 tui_field_fmt (struct ui_out *uiout, int fldno,
@@ -336,8 +353,10 @@ tui_text (struct ui_out *uiout, const char *string)
 }
 
 void
-tui_message (struct ui_out *uiout, int verbosity,
-            const char *format, va_list args)
+tui_message (struct ui_out *uiout, 
+            int verbosity,
+            const char *format, 
+            va_list args)
 {
   tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
@@ -362,14 +381,15 @@ tui_flush (struct ui_out *uiout)
   gdb_flush (data->stream);
 }
 
-/* local functions */
+/* Local functions.  */
 
-/* Like tui_field_fmt, but takes a variable number of args
-   and makes a va_list and does not insert a separator */
+/* Like tui_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,
+out_field_fmt (struct ui_out *uiout, 
+              int fldno,
               const char *fldname,
               const char *format,...)
 {
@@ -382,7 +402,7 @@ out_field_fmt (struct ui_out *uiout, int fldno,
   va_end (args);
 }
 
-/* access to ui_out format private members */
+/* Access to ui_out format private members.  */
 
 static void
 field_separator (void)
@@ -391,7 +411,7 @@ field_separator (void)
   fputc_filtered (' ', data->stream);
 }
 
-/* initalize private members at startup */
+/* Initalize private members at startup.  */
 
 struct ui_out *
 tui_out_new (struct ui_file *stream)
@@ -406,9 +426,9 @@ tui_out_new (struct ui_file *stream)
   return ui_out_new (&tui_ui_out_impl, data, flags);
 }
 
-/* standard gdb initialization hook */
+/* Standard gdb initialization hook.  */
 void
 _initialize_tui_out (void)
 {
-  /* nothing needs to be done */
+  /* Nothing needs to be done.  */
 }