Continue reforming error message support. In this phase, rename
[pspp] / src / language / data-io / data-reader.c
index 0a4baf6774fc48f0bb8e146a96bf7a7cab538e7c..8fc7a80ad7b0dc0ce3d894c6733e2e46fea9c83d 100644 (file)
@@ -28,7 +28,7 @@
 #include <libpspp/message.h>
 #include <language/data-io/file-handle.h>
 #include <data/file-handle-def.h>
-#include <data/filename.h>
+#include <data/file-name.h>
 #include <language/line-buffer.h>
 #include <language/lexer/lexer.h>
 #include <libpspp/str.h>
@@ -37,8 +37,6 @@
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-#include <libpspp/debug-print.h>
-
 /* Flags for DFM readers. */
 enum dfm_reader_flags
   {
@@ -52,7 +50,7 @@ enum dfm_reader_flags
 struct dfm_reader
   {
     struct file_handle *fh;     /* File handle. */
-    struct file_locator where;  /* Current location in data file. */
+    struct msg_locator where;   /* Current location in data file. */
     struct string line;         /* Current line. */
     struct string scratch;      /* Extra line buffer. */
     enum dfm_reader_flags flags; /* Zero or more of DFM_*. */
@@ -73,7 +71,7 @@ dfm_close_reader (struct dfm_reader *r)
     return;
 
   is_inline = r->fh == fh_inline_file ();
-  file_name = is_inline ? NULL : xstrdup (fh_get_filename (r->fh));
+  file_name = is_inline ? NULL : xstrdup (fh_get_file_name (r->fh));
   still_open = fh_close (r->fh, "data file", "rs");
   if (still_open) 
     {
@@ -125,13 +123,13 @@ dfm_open_reader (struct file_handle *fh)
   r->eof_cnt = 0;
   if (fh != fh_inline_file ()) 
     {
-      r->where.filename = fh_get_filename (fh);
+      r->where.file_name = fh_get_file_name (fh);
       r->where.line_number = 0; 
-      r->file = fn_open (fh_get_filename (fh), "rb");
+      r->file = fn_open (fh_get_file_name (fh), "rb");
       if (r->file == NULL)
         {
           msg (ME, _("Could not open \"%s\" for reading as a data file: %s."),
-               fh_get_filename (r->fh), strerror (errno));
+               fh_get_file_name (r->fh), strerror (errno));
           fh_close (fh,"data file", "rs");
           free (r);
           return NULL;
@@ -389,20 +387,20 @@ dfm_column_start (struct dfm_reader *r)
   return r->pos + 1;
 }
 
-/* Pushes the filename and line number on the fn/ln stack. */
+/* Pushes the file name and line number on the fn/ln stack. */
 void
 dfm_push (struct dfm_reader *r)
 {
   if (r->fh != fh_inline_file ())
-    err_push_file_locator (&r->where);
+    msg_push_msg_locator (&r->where);
 }
 
-/* Pops the filename and line number from the fn/ln stack. */
+/* Pops the file name and line number from the fn/ln stack. */
 void
 dfm_pop (struct dfm_reader *r)
 {
   if (r->fh != fh_inline_file ())
-    err_pop_file_locator (&r->where);
+    msg_pop_msg_locator (&r->where);
 }
 \f
 /* BEGIN DATA...END DATA procedure. */