message: Add column range to struct msg_locator.
[pspp] / src / data / por-file-reader.c
index 55f616ec76502eef0533353c3619be7fd069fd95..adf177bee71c7db83104a6789ee1b0f5053a0cba 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2006, 2009, 2010 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
@@ -37,7 +37,6 @@
 #include <data/value-labels.h>
 #include <data/variable.h>
 #include <libpspp/compiler.h>
-#include <libpspp/hash.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/pool.h>
@@ -96,8 +95,8 @@ error (struct pfm_reader *r, const char *msg, ...)
   va_list args;
 
   ds_init_empty (&text);
-  ds_put_format (&text, _("portable file %s corrupt at offset 0x%lx: "),
-                 fh_get_file_name (r->fh), ftell (r->file));
+  ds_put_format (&text, _("portable file %s corrupt at offset 0x%llx: "),
+                 fh_get_file_name (r->fh), (long long int) ftello (r->file));
   va_start (args, msg);
   ds_put_vformat (&text, msg, args);
   va_end (args);
@@ -106,6 +105,8 @@ error (struct pfm_reader *r, const char *msg, ...)
   m.severity = MSG_S_ERROR;
   m.where.file_name = NULL;
   m.where.line_number = 0;
+  m.where.first_column = 0;
+  m.where.last_column = 0;
   m.text = ds_cstr (&text);
 
   msg_emit (&m);
@@ -125,8 +126,8 @@ warning (struct pfm_reader *r, const char *msg, ...)
   va_list args;
 
   ds_init_empty (&text);
-  ds_put_format (&text, _("reading portable file %s at offset 0x%lx: "),
-                 fh_get_file_name (r->fh), ftell (r->file));
+  ds_put_format (&text, _("reading portable file %s at offset 0x%llx: "),
+                 fh_get_file_name (r->fh), (long long int) ftello (r->file));
   va_start (args, msg);
   ds_put_vformat (&text, msg, args);
   va_end (args);
@@ -135,6 +136,8 @@ warning (struct pfm_reader *r, const char *msg, ...)
   m.severity = MSG_S_WARNING;
   m.where.file_name = NULL;
   m.where.line_number = 0;
+  m.where.first_column = 0;
+  m.where.last_column = 0;
   m.text = ds_cstr (&text);
 
   msg_emit (&m);
@@ -153,7 +156,7 @@ close_reader (struct pfm_reader *r)
     {
       if (fn_close (fh_get_file_name (r->fh), r->file) == EOF)
         {
-          msg (ME, _("Error closing portable file \"%s\": %s."),
+          msg (ME, _("Error closing portable file `%s': %s."),
                fh_get_file_name (r->fh), strerror (errno));
           r->ok = false;
         }
@@ -272,7 +275,7 @@ pfm_open_reader (struct file_handle *fh, struct dictionary **dict,
   r->file = fn_open (fh_get_file_name (r->fh), "rb");
   if (r->file == NULL)
     {
-      msg (ME, _("An error occurred while opening \"%s\" for reading "
+      msg (ME, _("An error occurred while opening `%s' for reading "
                  "as a portable file: %s."),
            fh_get_file_name (r->fh), strerror (errno));
       goto error;