/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <config.h>
#include <gtk/gtk.h>
+#include <data/file-name.h>
#include "window-manager.h"
#include "output-viewer.h"
#include "helper.h"
the_output_viewer = NULL;
- unlink (OUTPUT_FILE_NAME);
+ unlink (output_file_name ());
return FALSE;
}
struct stat buf;
/* If there is no output, then don't do anything */
- if (0 != stat (OUTPUT_FILE_NAME, &buf))
+ if (0 != stat (output_file_name (), &buf))
return ;
if ( NULL == the_output_viewer )
}
+
void
reload_viewer (struct output_viewer *ov)
{
*/
{
GtkTextIter start_iter;
- FILE *fp = fopen (OUTPUT_FILE_NAME, "r");
+ FILE *fp = fopen (output_file_name (), "r");
if ( !fp)
{
- g_print ("Cannot open %s\n", OUTPUT_FILE_NAME);
+ g_warning ("Cannot open %s\n", output_file_name ());
return;
}
{
if ( ov->fp == NULL)
{
- ov->fp = fopen (OUTPUT_FILE_NAME, "r");
+ ov->fp = fopen (output_file_name (), "r");
if ( ov->fp == NULL)
{
- g_print ("Cannot open %s\n", OUTPUT_FILE_NAME);
+ g_warning ("Cannot open %s\n", output_file_name ());
return;
}
}
}
+const char *
+output_file_name (void)
+{
+ const char *dir = default_output_path ();
+ static char *filename = NULL;
+
+ if ( NULL == filename )
+ filename = xasprintf ("%s%s", dir, output_file_name ());
+
+ return filename;
+}