[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] Changes to pspp/src/format.c
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] Changes to pspp/src/format.c |
Date: |
Tue, 17 May 2005 01:46:44 -0400 |
Index: pspp/src/format.c
diff -u pspp/src/format.c:1.13 pspp/src/format.c:1.14
--- pspp/src/format.c:1.13 Mon May 16 07:33:17 2005
+++ pspp/src/format.c Tue May 17 05:46:39 2005
@@ -37,6 +37,9 @@
{"", -1, -1, -1, -1, -1, 0000, -1, -1},
};
+/* Common formats. */
+const struct fmt_spec f8_2 = {FMT_F, 8, 2};
+
/* Parses the alphabetic prefix of the current token as a format
specifier name. Returns the corresponding format specifier
type if successful, or -1 on failure. If ALLOW_XT is zero,
@@ -442,3 +445,29 @@
return type;
return -1;
}
+
+/* Returns an input format specification with type TYPE, width W,
+ and D decimals. */
+struct fmt_spec
+make_input_format (int type, int w, int d)
+{
+ struct fmt_spec f;
+ f.type = type;
+ f.w = w;
+ f.d = d;
+ assert (check_input_specifier (&f, 0));
+ return f;
+}
+
+/* Returns an output format specification with type TYPE, width
+ W, and D decimals. */
+struct fmt_spec
+make_output_format (int type, int w, int d)
+{
+ struct fmt_spec f;
+ f.type = type;
+ f.w = w;
+ f.d = d;
+ assert (check_output_specifier (&f, 0));
+ return f;
+}