+ int grouping = decimal == '.' ? ',' : '.';
+ assert (decimal == '.' || decimal == ',');
+
+ set_style (FMT_F, "", "", decimal, 0);
+ set_style (FMT_E, "", "", decimal, 0);
+ set_style (FMT_COMMA, "", "", decimal, grouping);
+ set_style (FMT_DOT, "", "", grouping, decimal);
+ set_style (FMT_DOLLAR, "$", "", decimal, grouping);
+ set_style (FMT_PCT, "", "%", decimal, 0);
+
+ init_style (FMT_CCA, "", "", decimal, grouping);
+ init_style (FMT_CCB, "", "", decimal, grouping);
+ init_style (FMT_CCC, "", "", decimal, grouping);
+ init_style (FMT_CCD, "", "", decimal, grouping);
+ init_style (FMT_CCE, "", "", decimal, grouping);
+}
+\f
+/* Returns the struct fmt_desc for the given format TYPE. */
+static const struct fmt_desc *
+get_fmt_desc (enum fmt_type type)
+{
+ static const struct fmt_desc formats[FMT_NUMBER_OF_FORMATS] =
+ {
+#define FMT(NAME, METHOD, IMIN, OMIN, IO, CATEGORY) \
+ {#NAME, IMIN, OMIN, IO, CATEGORY},
+#include "format.def"
+ };
+
+ assert (is_fmt_type (type));
+ return &formats[type];