Separated getl.c into getl.c and readln.c
[pspp] / src / data-out.c
index 2600ccb8037dfac35af8494b60b6c5b23a6eaa9f..c9c17a5e642fd6f14fcefe1472df9586dd44bdae 100644 (file)
@@ -56,7 +56,7 @@ static string_converter convert_A, convert_AHEX;
 /* Converts binary value V into printable form in the exactly
    FP->W character in buffer S according to format specification
    FP.  No null terminator is appended to the buffer.  */
-void
+bool
 data_out (char *s, const struct fmt_spec *fp, const union value *v)
 {
   int cat = formats[fp->type].cat;
@@ -73,7 +73,7 @@ data_out (char *s, const struct fmt_spec *fp, const union value *v)
         {
           memset (s, ' ', fp->w);
           s[fp->w - fp->d - 1] = '.';
-          return;
+          return true;
         }
 
       /* Handle decimal shift. */
@@ -189,6 +189,8 @@ data_out (char *s, const struct fmt_spec *fp, const union value *v)
   /* Error handling. */
   if (!ok)
     strncpy (s, "ERROR", fp->w);
+  
+  return ok;
 }
 
 /* Converts V into S in F format with width W and D decimal places,
@@ -963,7 +965,7 @@ year4 (int year)
 static int
 try_CCx (char *dst, const struct fmt_spec *fp, double number)
 {
-  const struct set_cust_currency *cc = get_cc(fp->type - FMT_CCA);
+  const struct custom_currency *cc = get_cc(fp->type - FMT_CCA);
 
   struct fmt_spec f;
 
@@ -973,7 +975,7 @@ try_CCx (char *dst, const struct fmt_spec *fp, double number)
 
   /* Determine length available, decimal character for number
      proper. */
-  f.type = cc->decimal == get_decimal() ? FMT_COMMA : FMT_DOT;
+  f.type = cc->decimal == get_decimal () ? FMT_COMMA : FMT_DOT;
   f.w = fp->w - strlen (cc->prefix) - strlen (cc->suffix);
   if (number < 0)
     f.w -= strlen (cc->neg_prefix) + strlen (cc->neg_suffix) - 1;