+2014-12-12 Tom Tromey <tromey@redhat.com>
+
+ * ui-file.h (ui_file_write_for_put): Declare.
+ * ui-file.c (ui_file_write_for_put): New function.
+ * mi/mi-out.c (do_write): Remove.
+ (mi_out_put): Use ui_file_write_for_put.
+
2014-12-12 Doug Evans <dje@google.com>
* NEWS: Mention gdb.lookup_objfile.
/* Dump the buffer onto the specified stream. */
-static void
-do_write (void *data, const char *buffer, long length_buffer)
-{
- ui_file_write (data, buffer, length_buffer);
-}
-
void
mi_out_put (struct ui_out *uiout, struct ui_file *stream)
{
mi_out_data *data = ui_out_data (uiout);
- ui_file_put (data->buffer, do_write, stream);
+ ui_file_put (data->buffer, ui_file_write_for_put, stream);
ui_file_rewind (data->buffer);
}
file->to_write (file, buf, length_buf);
}
+void
+ui_file_write_for_put (void *data, const char *buffer, long length_buffer)
+{
+ ui_file_write (data, buffer, length_buffer);
+}
+
void
ui_file_write_async_safe (struct ui_file *file,
const char *buf,
extern void ui_file_write (struct ui_file *file, const char *buf,
long length_buf);
+/* A wrapper for ui_file_write that is suitable for use by
+ ui_file_put. */
+
+extern void ui_file_write_for_put (void *data, const char *buffer,
+ long length_buffer);
+
extern void ui_file_write_async_safe (struct ui_file *file, const char *buf,
long length_buf);