From beaaf574bfe6cb503269970fc53ebeacf63eae57 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 31 Oct 2000 06:06:35 +0000 Subject: Update. * locale/localeinfo.h (enum value_type): Add wstring, wstringarray, and wstringlist. * locale/categories.def: Mark wide char strings as wstring or stringarray. * locale/programs/locale.c (show_info): Handle wstring, wstringarray, and wstringlist. Print keywords only if there is real output. Reported by Chen Xiangyang . * sysdeps/sparc/fpu/bits/mathinline.h: Add __THROW where necessary. Patch by Ben Collins . --- locale/programs/locale.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'locale/programs/locale.c') diff --git a/locale/programs/locale.c b/locale/programs/locale.c index 7a42f1e3a4..0b61467c1f 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -551,17 +551,15 @@ show_info (const char *name) void print_item (struct cat_item *item) { - if (show_keyword_name != 0) - printf ("%s=", item->name); - switch (item->value_type) { case string: if (show_keyword_name) - putchar ('"'); + printf ("%s=\"", item->name); print_escaped (nl_langinfo (item->item_id) ? : ""); if (show_keyword_name) putchar ('"'); + putchar ('\n'); break; case stringarray: { @@ -569,7 +567,7 @@ show_info (const char *name) const char *val; if (show_keyword_name) - putchar ('"'); + printf ("%s=\"", item->name); for (cnt = 0; cnt < item->max - 1; ++cnt) { @@ -585,6 +583,7 @@ show_info (const char *name) if (show_keyword_name) putchar ('"'); + putchar ('\n'); } break; case stringlist: @@ -592,6 +591,9 @@ show_info (const char *name) int first = 1; const char *val = nl_langinfo (item->item_id) ? : ""; + if (show_keyword_name) + printf ("%s=", item->name); + while (*val != '\0') { printf ("%s%s%s%s", first ? "" : ";", @@ -600,14 +602,19 @@ show_info (const char *name) val = strchr (val, '\0') + 1; first = 0; } + putchar ('\n'); } break; case byte: { const char *val = nl_langinfo (item->item_id); + if (show_keyword_name) + printf ("%s=", item->name); + if (val != NULL) printf ("%d", *val == CHAR_MAX ? -1 : *val); + putchar ('\n'); } break; case bytearray: @@ -615,6 +622,9 @@ show_info (const char *name) const char *val = nl_langinfo (item->item_id); int cnt = val ? strlen (val) : 0; + if (show_keyword_name) + printf ("%s=", item->name); + while (cnt > 1) { printf ("%d;", *val == CHAR_MAX ? -1 : *val); @@ -622,19 +632,26 @@ show_info (const char *name) ++val; } - printf ("%d", cnt == 0 || *val == CHAR_MAX ? -1 : *val); + printf ("%d\n", cnt == 0 || *val == CHAR_MAX ? -1 : *val); } break; case word: { unsigned int val = (unsigned int) (unsigned long int) nl_langinfo (item->item_id); - printf ("%d", val); + if (show_keyword_name) + printf ("%s=", item->name); + + printf ("%d\n", val); } break; + case wstring: + case wstringarray: + case wstringlist: + /* We don't print wide character information since the same + information is available in a multibyte string. */ default: } - putchar ('\n'); } for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no) -- cgit v1.2.3