+2010-02-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * locale.cc (print_lc_mstrings): New function to print
+ semicolon-separated strings.
+ (enum type_t): New type is_sepstrings_linf.
+ (lc_time_names): Change type of era and alt_digits entry to
+ is_sepstrings_linf.
+ (print_lc): Add case for is_sepstrings_linf and call print_lc_mstrings
+ in that case.
+
2010-02-17 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (CYGWIN_BINS): Rename getlocale to locale.
}
void
+print_lc_sepstrings (int key, const char *name, const char *value)
+{
+ char *c;
+
+ if (key)
+ printf ("%s=", name);
+ while (value && *value)
+ {
+ if (key)
+ fputc ('"', stdout);
+ c = strchr (value, ';');
+ if (!c)
+ {
+ fputs (value, stdout);
+ value = NULL;
+ }
+ else
+ {
+ printf ("%.*s", c - value, value);
+ value = c + 1;
+ }
+ if (key)
+ fputc ('"', stdout);
+ if (value && *value)
+ fputc (';', stdout);
+ }
+ fputc ('\n', stdout);
+}
+
+void
print_lc_strings (int key, const char *name, int from, int to)
{
if (key)
is_grouping_lconv,
is_string_linf,
is_mstrings_linf,
+ is_sepstrings_linf,
is_mb_cur_max,
is_codeset,
is_end
{ "d_fmt", is_string_linf, D_FMT, 0 },
{ "t_fmt", is_string_linf, T_FMT, 0 },
{ "t_fmt_ampm", is_string_linf, T_FMT_AMPM, 0 },
- { "era", is_string_linf, ERA, 0 },
+ { "era", is_sepstrings_linf,ERA, 0 },
{ "era_d_fmt", is_string_linf, ERA_D_FMT, 0 },
- { "alt_digits", is_string_linf, ALT_DIGITS, 0 },
+ { "alt_digits", is_sepstrings_linf,ALT_DIGITS, 0 },
{ "era_d_t_fmt", is_string_linf, ERA_D_T_FMT, 0 },
{ "era_t_fmt", is_string_linf, ERA_T_FMT, 0 },
{ "time-codeset", is_codeset, LC_TIME, 0 },
case is_string_linf:
print_lc_svalue (key, lc->name, nl_langinfo (lc->fromval));
break;
+ case is_sepstrings_linf:
+ print_lc_sepstrings (key, lc->name, nl_langinfo (lc->fromval));
+ break;
case is_mstrings_linf:
print_lc_strings (key, lc->name, lc->fromval, lc->toval);
break;