2001-05-10 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Thu, 10 May 2001 21:30:37 +0000 (21:30 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 10 May 2001 21:30:37 +0000 (21:30 +0000)
* ui-out.h (make_cleanup_ui_out_begin_end): Declare.
* ui-out.c (struct ui_out_end_cleanup_data): Define.
(do_cleanup_end): New function.  Replace do_list_end.
(make_cleanup_ui_out_end): New function.
(make_cleanup_ui_out_begin_end): New function.
(make_cleanup_ui_out_list_end): Use make_cleanup_ui_out_end.

gdb/ChangeLog
gdb/ui-out.c
gdb/ui-out.h

index 736718736b92609a7d08655f8d8f9aff121cf5e1..1eaed0da7da8901c3890a4228c42e1b29ce18ee5 100644 (file)
@@ -1,3 +1,12 @@
+2001-05-10  Andrew Cagney  <ac131313@redhat.com>
+
+       * ui-out.h (make_cleanup_ui_out_begin_end): Declare.
+       * ui-out.c (struct ui_out_end_cleanup_data): Define.
+       (do_cleanup_end): New function.  Replace do_list_end.
+       (make_cleanup_ui_out_end): New function.
+       (make_cleanup_ui_out_begin_end): New function.
+       (make_cleanup_ui_out_list_end): Use make_cleanup_ui_out_end.
+
 2001-05-10  Elena Zannoni  <ezannoni@redhat.com>
 
         * MAINTAINERS: Declare xcoffread.c open to all maintainers,
index 696128d0b6fbf2241bc16097c3f4f8e8de53d439..3e0f55c97c1fc5e29cbb0495a7354e72d76f3dcd 100644 (file)
@@ -352,16 +352,44 @@ ui_out_list_end (struct ui_out *uiout)
   ui_out_end (uiout, ui_out_type_list);
 }
 
+struct ui_out_end_cleanup_data
+{
+  struct ui_out *uiout;
+  enum ui_out_type type;
+};
+
 static void
-do_list_end (void *uiout)
+do_cleanup_end (void *data)
+{
+  struct ui_out_end_cleanup_data *end_cleanup_data = data;
+  ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type);
+  xfree (end_cleanup_data);
+}
+
+static struct cleanup *
+make_cleanup_ui_out_end (struct ui_out *uiout,
+                        enum ui_out_type type)
+{
+  struct ui_out_end_cleanup_data *end_cleanup_data;
+  end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data);
+  end_cleanup_data->uiout = uiout;
+  end_cleanup_data->type = type;
+  return make_cleanup (do_cleanup_end, end_cleanup_data);
+}
+
+struct cleanup *
+make_cleanup_ui_out_begin_end (struct ui_out *uiout,
+                              enum ui_out_type type,
+                              const char *id)
 {
-  ui_out_list_end (uiout);
+  ui_out_begin (uiout, type, id);
+  return make_cleanup_ui_out_end (uiout, type);
 }
 
 struct cleanup *
 make_cleanup_ui_out_list_end (struct ui_out *uiout)
 {
-  return make_cleanup (do_list_end, uiout);
+  return make_cleanup_ui_out_end (uiout, ui_out_type_list);
 }
 
 void
index a537412e0abd4f02fb498ac6aaa686635c7bd0b9..ed2a289f0b523817310402e5166f108ae8b6370b 100644 (file)
@@ -80,6 +80,10 @@ extern void ui_out_begin (struct ui_out *uiout,
 
 extern void ui_out_end (struct ui_out *uiout, enum ui_out_type type);
 
+extern struct cleanup *ui_out_begin_cleanup_end (struct ui_out *uiout,
+                                                enum ui_out_type level_type,
+                                                const char *id);
+
 /* A table can be considered a special tupple/list combination with
    the implied structure: ``table = { hdr = { header, ... } , body = [ {
    field, ... }, ... ] }'' */
This page took 0.028354 seconds and 4 git commands to generate.