aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.h
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@sourceware.org>2013-02-12 01:47:49 +0000
committerSiva Chandra Reddy <sivachandra@sourceware.org>2013-02-12 01:47:49 +0000
commitb65a2bd9297dcbdb55c0a84e38246553b5255ac7 (patch)
tree44d8e9cb571ade6e0a968189c2b1d772aa962281 /gdb/ui-out.h
parent52df48454323793caaf042dd677689f7a71fb997 (diff)
downloadgdb-b65a2bd9297dcbdb55c0a84e38246553b5255ac7.zip
gdb-b65a2bd9297dcbdb55c0a84e38246553b5255ac7.tar.gz
gdb-b65a2bd9297dcbdb55c0a84e38246553b5255ac7.tar.bz2
Add support for a destructor for ui_out data and use it to
provide a ui_out destructor. * ui-out.h: Declare the new ui_out destructor. (ui_out_impl): Add a field for data destructor in ui_out_impl. * ui-out.c (default_data_destroy): Add a default data destructor which does nothing. (default_ui_out_impl): Set the new data_destroy field to default_data_destroy (uo_data_destroy): Local function which invokes the data destructor if present. (clear_table): Local function which clears the table data of a ui_out object. (ui_out_destroy): Public function which frees a ui_out object. (ui_out_table_end): Use the new clear_table function. * cli-out.c (cli_ui_out_impl): Set the new data_destroy field to NULL. * mi/mi-out.c (mi_ui_out_impl): Set the new data_destroy field to NULL.
Diffstat (limited to 'gdb/ui-out.h')
-rw-r--r--gdb/ui-out.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 3de567a..b07496e 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -197,6 +197,7 @@ typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring);
typedef void (flush_ftype) (struct ui_out * uiout);
typedef int (redirect_ftype) (struct ui_out * uiout,
struct ui_file * outstream);
+typedef void (data_destroy_ftype) (struct ui_out *uiout);
/* ui-out-impl */
@@ -221,6 +222,7 @@ struct ui_out_impl
wrap_hint_ftype *wrap_hint;
flush_ftype *flush;
redirect_ftype *redirect;
+ data_destroy_ftype *data_destroy;
int is_mi_like_p;
};
@@ -236,6 +238,10 @@ extern struct ui_out *ui_out_new (struct ui_out_impl *impl,
void *data,
int flags);
+/* Destroy a ui_out object. */
+
+extern void ui_out_destroy (struct ui_out *uiout);
+
/* Redirect the ouptut of a ui_out object temporarily. */
extern int ui_out_redirect (struct ui_out *uiout, struct ui_file *outstream);