Eliminated global variable current_dataset.
[pspp-builds.git] / src / language / data-io / data-writer.c
index eb5fe01963012a57626760fcc7b226825fc94395..23220cd19d6f92ca07cbc1e293568d9110a6a3ce 100644 (file)
@@ -25,7 +25,7 @@
 #include <libpspp/alloc.h>
 #include <libpspp/message.h>
 #include <language/data-io/file-handle.h>
-#include <data/filename.h>
+#include <data/file-name.h>
 #include <libpspp/str.h>
 
 #include "gettext.h"
@@ -54,14 +54,14 @@ dfm_open_writer (struct file_handle *fh)
 
   w = *aux = xmalloc (sizeof *w);
   w->fh = fh;
-  w->file = fn_open (fh_get_filename (w->fh), "wb");
+  w->file = fn_open (fh_get_file_name (w->fh), "wb");
   w->bounce = NULL;
 
   if (w->file == NULL)
     {
       msg (ME, _("An error occurred while opening \"%s\" for writing "
                  "as a data file: %s."),
-           fh_get_filename (w->fh), strerror (errno));
+           fh_get_file_name (w->fh), strerror (errno));
       goto error;
     }
 
@@ -80,15 +80,15 @@ dfm_write_error (const struct dfm_writer *writer)
 }
 
 /* Writes record REC having length LEN to the file corresponding to
-   HANDLE.  REC is not null-terminated.  Returns nonzero on success,
-   zero on failure. */
-int
+   HANDLE.  REC is not null-terminated.  Returns true on success,
+   false on failure. */
+bool
 dfm_put_record (struct dfm_writer *w, const char *rec, size_t len)
 {
   assert (w != NULL);
 
   if (dfm_write_error (w))
-    return 0;
+    return false;
   
   if (fh_get_mode (w->fh) == FH_MODE_BINARY
       && len < fh_get_record_width (w->fh))