X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fdata-reader.c;h=8fc7a80ad7b0dc0ce3d894c6733e2e46fea9c83d;hb=d5e3c75df80897a583aedcdbd4269a7ca5ccc491;hp=0a4baf6774fc48f0bb8e146a96bf7a7cab538e7c;hpb=ae9f5561a7fdeb23707bf355e06f3ca04824e738;p=pspp diff --git a/src/language/data-io/data-reader.c b/src/language/data-io/data-reader.c index 0a4baf6774..8fc7a80ad7 100644 --- a/src/language/data-io/data-reader.c +++ b/src/language/data-io/data-reader.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -37,8 +37,6 @@ #include "gettext.h" #define _(msgid) gettext (msgid) -#include - /* 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); } /* BEGIN DATA...END DATA procedure. */