Fix ia64-linux fortran common linking problem.
[deliverable/binutils-gdb.git] / gdb / ui-out.c
index 40e126e6e64f623ec1b7860d4d9f1c7bd9d2cf72..5fe212bcd066bacb277416509128a93774e87107 100644 (file)
@@ -39,6 +39,7 @@ struct ui_out_hdr
     int colno;
     int width;
     int alignment;
+    char *col_name;
     char *colhdr;
     struct ui_out_hdr *next;
   };
@@ -135,11 +136,11 @@ pop_level (struct ui_out *uiout,
 /* These are the default implementation functions */
 
 static void default_table_begin (struct ui_out *uiout, int nbrofcols,
-                                const char *tblid);
+                                int nr_rows, const char *tblid);
 static void default_table_body (struct ui_out *uiout);
 static void default_table_end (struct ui_out *uiout);
 static void default_table_header (struct ui_out *uiout, int width,
-                                 enum ui_align alig,
+                                 enum ui_align alig, const char *col_name,
                                  const char *colhdr);
 static void default_begin (struct ui_out *uiout,
                           enum ui_out_type type,
@@ -209,11 +210,12 @@ struct ui_out *uiout = &def_uiout;
 /* These are the interfaces to implementation functions */
 
 static void uo_table_begin (struct ui_out *uiout, int nbrofcols,
-                           const char *tblid);
+                           int nr_rows, const char *tblid);
 static void uo_table_body (struct ui_out *uiout);
 static void uo_table_end (struct ui_out *uiout);
 static void uo_table_header (struct ui_out *uiout, int width,
-                            enum ui_align align, const char *colhdr);
+                            enum ui_align align, const char *col_name,
+                            const char *colhdr);
 static void uo_begin (struct ui_out *uiout,
                      enum ui_out_type type,
                      int level, const char *id);
@@ -241,7 +243,8 @@ static void uo_flush (struct ui_out *uiout);
 
 extern void _initialize_ui_out (void);
 static void append_header_to_list (struct ui_out *uiout, int width,
-                                  int alignment, const char *colhdr);
+                                  int alignment, const char *col_name,
+                                  const char *colhdr);
 static int get_curr_header (struct ui_out *uiout, int *colno, int *width,
                            int *alignment, char **colhdr);
 static void clear_header_list (struct ui_out *uiout);
@@ -256,6 +259,7 @@ static void init_ui_out_state (struct ui_out *uiout);
 
 void
 ui_out_table_begin (struct ui_out *uiout, int nbrofcols,
+                   int nr_rows,
                    const char *tblid)
 {
   if (uiout->table_flag)
@@ -271,7 +275,7 @@ previous table_end.");
     uiout->table_id = NULL;
   clear_header_list (uiout);
 
-  uo_table_begin (uiout, nbrofcols, uiout->table_id);
+  uo_table_begin (uiout, nbrofcols, nr_rows, uiout->table_id);
 }
 
 void
@@ -315,6 +319,7 @@ ui_out_table_end (struct ui_out *uiout)
 
 void
 ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+                    const char *col_name,
                     const char *colhdr)
 {
   if (!uiout->table_flag || uiout->body_flag)
@@ -322,9 +327,9 @@ ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
                    "table header must be specified after table_begin \
 and before table_body.");
 
-  append_header_to_list (uiout, width, alignment, colhdr);
+  append_header_to_list (uiout, width, alignment, col_name, colhdr);
 
-  uo_table_header (uiout, width, alignment, colhdr);
+  uo_table_header (uiout, width, alignment, col_name, colhdr);
 }
 
 void
@@ -344,9 +349,10 @@ specified after table_body.");
 }
 
 void
-ui_out_list_begin (struct ui_out *uiout)
+ui_out_list_begin (struct ui_out *uiout,
+                  const char *id)
 {
-  ui_out_begin (uiout, ui_out_type_list, NULL);
+  ui_out_begin (uiout, ui_out_type_list, id);
 }
 
 void
@@ -418,8 +424,10 @@ make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout,
 }
 
 struct cleanup *
-make_cleanup_ui_out_list_begin_end (struct ui_out *uiout)
+make_cleanup_ui_out_list_begin_end (struct ui_out *uiout,
+                                   const char *id)
 {
+  ui_out_list_begin (uiout, id);
   return make_cleanup_ui_out_end (uiout, ui_out_type_list);
 }
 
@@ -707,7 +715,9 @@ gdb_query (struct ui_out *uiout, int qflags, char *qprompt)
 /* default gdb-out hook functions */
 
 static void
-default_table_begin (struct ui_out *uiout, int nbrofcols, const char *tblid)
+default_table_begin (struct ui_out *uiout, int nbrofcols,
+                    int nr_rows,
+                    const char *tblid)
 {
 }
 
@@ -723,6 +733,7 @@ default_table_end (struct ui_out *uiout)
 
 static void
 default_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
+                     const char *col_name,
                      const char *colhdr)
 {
 }
@@ -805,11 +816,12 @@ default_flush (struct ui_out *uiout)
 
 void
 uo_table_begin (struct ui_out *uiout, int nbrofcols,
+               int nr_rows,
                const char *tblid)
 {
   if (!uiout->impl->table_begin)
     return;
-  uiout->impl->table_begin (uiout, nbrofcols, tblid);
+  uiout->impl->table_begin (uiout, nbrofcols, nr_rows, tblid);
 }
 
 void
@@ -830,11 +842,12 @@ uo_table_end (struct ui_out *uiout)
 
 void
 uo_table_header (struct ui_out *uiout, int width, enum ui_align align,
+                const char *col_name,
                 const char *colhdr)
 {
   if (!uiout->impl->table_header)
     return;
-  uiout->impl->table_header (uiout, width, align, colhdr);
+  uiout->impl->table_header (uiout, width, align, col_name, colhdr);
 }
 
 void
@@ -965,6 +978,7 @@ static void
 append_header_to_list (struct ui_out *uiout,
                       int width,
                       int alignment,
+                      const char *col_name,
                       const char *colhdr)
 {
   struct ui_out_hdr *temphdr;
@@ -974,10 +988,13 @@ append_header_to_list (struct ui_out *uiout,
   temphdr->alignment = alignment;
   /* we have to copy the column title as the original may be an automatic */
   if (colhdr != NULL)
-    {
-      temphdr->colhdr = xmalloc (strlen (colhdr) + 1);
-      strcpy (temphdr->colhdr, colhdr);
-    }
+    temphdr->colhdr = xstrdup (colhdr);
+  else
+    temphdr->colhdr = NULL;
+  if (col_name != NULL)
+    temphdr->col_name = xstrdup (colhdr);
+  else
+    temphdr->col_name = xstrdup (colhdr);
   temphdr->next = NULL;
   if (uiout->headerfirst == NULL)
     {
This page took 0.029236 seconds and 4 git commands to generate.