Encapsulated msg_location inside msg_emit
[pspp-builds.git] / src / data / data-in.c
index 9da8db8025c6a06b8b251848b422cdd1e4fb5593..0b9e0623265562229d7982cdc0d86f5b99823fc2 100644 (file)
@@ -48,26 +48,25 @@ static void dls_error (const struct data_in *, const char *format, ...)
 static void
 vdls_error (const struct data_in *i, const char *format, va_list args)
 {
-  struct error e;
+  struct msg m;
   struct string text;
 
   if (i->flags & DI_IGNORE_ERROR)
     return;
 
-  ds_init (&text, 64);
+  ds_init_empty (&text);
   if (i->f1 == i->f2)
-    ds_printf (&text, _("(column %d"), i->f1);
+    ds_put_format (&text, _("(column %d"), i->f1);
   else
-    ds_printf (&text, _("(columns %d-%d"), i->f1, i->f2);
-  ds_printf (&text, _(", field type %s) "), fmt_to_string (&i->format));
-  ds_vprintf (&text, format, args);
+    ds_put_format (&text, _("(columns %d-%d"), i->f1, i->f2);
+  ds_put_format (&text, _(", field type %s) "), fmt_to_string (&i->format));
+  ds_put_vformat (&text, format, args);
 
-  e.category = MSG_DATA;
-  e.severity = MSG_ERROR;
-  err_location (&e.where);
-  e.text = ds_c_str (&text);
+  m.category = MSG_DATA;
+  m.severity = MSG_ERROR;
+  m.text = ds_cstr (&text);
 
-  err_msg (&e);
+  msg_emit (&m);
 }
 
 static void
@@ -568,10 +567,12 @@ parse_RB (struct data_in *i)
   return true;
 }
 
+
 static inline bool
 parse_A (struct data_in *i)
 {
   buf_copy_rpad (i->v->s, i->format.w, i->s, i->e - i->s);
+  
   return true;
 }