X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fdata%2Fpor-file-reader.c;h=5b49fa5aa90632e41d013f581b538debad13bb5a;hb=cc07e50f2779af741e913b6454565c07efba0caf;hp=c4fec4b0ed72d30a2608c9b6af49340d35d40384;hpb=f19d8882cd0ecbf7811c73c2a3cf9ffe422d39d5;p=pspp diff --git a/src/data/por-file-reader.c b/src/data/por-file-reader.c index c4fec4b0ed..5b49fa5aa9 100644 --- a/src/data/por-file-reader.c +++ b/src/data/por-file-reader.c @@ -47,8 +47,6 @@ #include "gettext.h" #define _(msgid) gettext (msgid) -#include - /* portable_to_local[PORTABLE] translates the given portable character into the local character set. */ static const char portable_to_local[256] = @@ -88,17 +86,18 @@ static void error (struct pfm_reader *r, const char *msg, ...) { struct error e; - const char *filename; + const char *file_name; char *title; va_list args; - e.class = ME; - e.where.filename = NULL; + e.category = MSG_GENERAL; + e.severity = MSG_ERROR; + e.where.file_name = NULL; e.where.line_number = 0; - filename = fh_get_filename (r->fh); - e.title = title = pool_alloc (r->pool, strlen (filename) + 80); + file_name = fh_get_file_name (r->fh); + e.title = title = pool_alloc (r->pool, strlen (file_name) + 80); sprintf (title, _("portable file %s corrupt at offset %ld: "), - filename, ftell (r->file)); + file_name, ftell (r->file)); va_start (args, msg); err_vmsg (&e, msg, args); @@ -174,7 +173,7 @@ pfm_open_reader (struct file_handle *fh, struct dictionary **dict, if (setjmp (r->bail_out)) goto error; r->fh = fh; - r->file = pool_fopen (r->pool, fh_get_filename (r->fh), "rb"); + r->file = pool_fopen (r->pool, fh_get_file_name (r->fh), "rb"); r->weight_index = -1; r->trans = NULL; r->var_cnt = 0; @@ -187,7 +186,7 @@ pfm_open_reader (struct file_handle *fh, struct dictionary **dict, { msg (ME, _("An error occurred while opening \"%s\" for reading " "as a portable file: %s."), - fh_get_filename (r->fh), strerror (errno)); + fh_get_file_name (r->fh), strerror (errno)); goto error; } @@ -405,7 +404,7 @@ read_header (struct pfm_reader *r) for (i = 0; i < 8; i++) if (!match (r, "SPSSPORT"[i])) { - msg (SE, _("%s: Not a portable file."), fh_get_filename (r->fh)); + msg (SE, _("%s: Not a portable file."), fh_get_file_name (r->fh)); longjmp (r->bail_out, 1); } }