return acc.buffer;
}
+/* ui_file utility function for converting a ``struct ui_file'' into a
+ std:string. */
+
+static void
+do_ui_file_as_string (void *context, const char *buffer, long length)
+{
+ std::string *str = (std::string *) context;
+
+ *str = std::string (buffer, length);
+}
+
+/* See ui-file.h. */
+
+std::string
+ui_file_as_string (struct ui_file *file)
+{
+ std::string str;
+
+ ui_file_put (file, do_ui_file_as_string, &str);
+ return str;
+}
+
static void
do_ui_file_obsavestring (void *context, const char *buffer, long length)
{
#endif
struct ui_file *
-stderr_fileopen (void)
+stderr_fileopen (FILE *stream)
{
- struct ui_file *ui_file = stdio_fileopen (stderr);
+ struct ui_file *ui_file = stdio_fileopen (stream);
#ifdef __MINGW32__
/* There is no real line-buffering on Windows, see