aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-31 06:06:35 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-31 06:06:35 +0000
commitbeaaf574bfe6cb503269970fc53ebeacf63eae57 (patch)
tree4cc9d21aeba24007193b2623caaee7eb4a7e87ce
parentde153e7f50baa4ea7fac013f3b77b3a4fe314664 (diff)
downloadglibc-beaaf574bfe6cb503269970fc53ebeacf63eae57.zip
glibc-beaaf574bfe6cb503269970fc53ebeacf63eae57.tar.gz
glibc-beaaf574bfe6cb503269970fc53ebeacf63eae57.tar.bz2
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 <chenxy@opencjk.org>. * sysdeps/sparc/fpu/bits/mathinline.h: Add __THROW where necessary. Patch by Ben Collins <bcollins@debian.org>.
-rw-r--r--ChangeLog11
-rw-r--r--locale/categories.def98
-rw-r--r--locale/localeinfo.h5
-rw-r--r--locale/programs/locale.c33
-rw-r--r--sysdeps/sparc/fpu/bits/mathinline.h13
5 files changed, 95 insertions, 65 deletions
diff --git a/ChangeLog b/ChangeLog
index 78e5d31..9846fd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2000-10-30 Ulrich Drepper <drepper@redhat.com>
+ * 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 <chenxy@opencjk.org>.
+
+ * sysdeps/sparc/fpu/bits/mathinline.h: Add __THROW where necessary.
+ Patch by Ben Collins <bcollins@debian.org>.
+
* stdio-common/Makefile (tests): Add tst-fmemopen.
* stdio-common/tst-fmemopen.c: New file.
Test case by Ben Collins <bcollins@debian.org>.
diff --git a/locale/categories.def b/locale/categories.def
index 561cae9..c5ef6dc 100644
--- a/locale/categories.def
+++ b/locale/categories.def
@@ -44,19 +44,19 @@ DEFINE_CATEGORY
(
DEFINE_ELEMENT (_NL_COLLATE_NRULES, "collate-nrules", std, word)
DEFINE_ELEMENT (_NL_COLLATE_RULESETS, "collate-rulesets", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_TABLEMB, "collate-tablemb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_WEIGHTMB, "collate-weightmb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_EXTRAMB, "collate-extramb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_INDIRECTMB, "collate-indirectmb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_TABLEWC, "collate-tablewc", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_WEIGHTWC, "collate-weightwc", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_EXTRAWC, "collate-extrawc", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_INDIRECTWC, "collate-indirectwc", std, string)
+ DEFINE_ELEMENT (_NL_COLLATE_TABLEMB, "collate-tablemb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_WEIGHTMB, "collate-weightmb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_EXTRAMB, "collate-extramb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_INDIRECTMB, "collate-indirectmb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_TABLEWC, "collate-tablewc", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_WEIGHTWC, "collate-weightwc", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_EXTRAWC, "collate-extrawc", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_INDIRECTWC, "collate-indirectwc", std, wstring)
DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_SIZEMB, "collate-symb-hash-sizemb", std, word)
- DEFINE_ELEMENT (_NL_COLLATE_SYMB_TABLEMB, "collate-symb-tablemb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_SYMB_EXTRAMB, "collate-symb-extramb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_COLLSEQMB, "collate-collseqmb", std, string)
- DEFINE_ELEMENT (_NL_COLLATE_COLLSEQWC, "collate-collseqwc", std, string)
+ DEFINE_ELEMENT (_NL_COLLATE_SYMB_TABLEMB, "collate-symb-tablemb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_SYMB_EXTRAMB, "collate-symb-extramb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_COLLSEQMB, "collate-collseqmb", std, wstring)
+ DEFINE_ELEMENT (_NL_COLLATE_COLLSEQWC, "collate-collseqwc", std, wstring)
), NO_POSTLOAD)
@@ -67,17 +67,17 @@ DEFINE_CATEGORY
(
LC_CTYPE, "LC_CTYPE",
(
- DEFINE_ELEMENT (_NL_CTYPE_CLASS, "ctype-class", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TOUPPER, "ctype-toupper", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TOLOWER, "ctype-tolower", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_CLASS32, "ctype-class32", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_CLASS, "ctype-class", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_TOUPPER, "ctype-toupper", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_TOLOWER, "ctype-tolower", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_CLASS32, "ctype-class32", std, wstring)
DEFINE_ELEMENT (_NL_CTYPE_CLASS_NAMES, "ctype-class-names", std, stringlist)
DEFINE_ELEMENT (_NL_CTYPE_MAP_NAMES, "ctype-map-names", std, stringlist)
DEFINE_ELEMENT (_NL_CTYPE_WIDTH, "ctype-width", std, bytearray)
DEFINE_ELEMENT (_NL_CTYPE_MB_CUR_MAX, "ctype-mb-cur-max", std, word)
DEFINE_ELEMENT (_NL_CTYPE_CODESET_NAME, "charmap", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TOUPPER32, "ctype-toupper32", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TOLOWER32, "ctype-tolower32", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TOUPPER32, "ctype-toupper32", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_TOLOWER32, "ctype-tolower32", std, wstring)
DEFINE_ELEMENT (_NL_CTYPE_CLASS_OFFSET, "ctype-class-offset", std, word)
DEFINE_ELEMENT (_NL_CTYPE_MAP_OFFSET, "ctype-map-offset", std, word)
DEFINE_ELEMENT (_NL_CTYPE_INDIGITS_MB_LEN, "ctype-indigits_mb-len", std, word)
@@ -92,16 +92,16 @@ DEFINE_CATEGORY
DEFINE_ELEMENT (_NL_CTYPE_INDIGITS8_MB, "ctype-indigits8_mb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_INDIGITS9_MB, "ctype-indigits9_mb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_INDIGITS_WC_LEN, "ctype-indigits_wc-len", std, word)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS0_WC, "ctype-indigits0_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS1_WC, "ctype-indigits1_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS2_WC, "ctype-indigits2_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS3_WC, "ctype-indigits3_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS4_WC, "ctype-indigits4_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS5_WC, "ctype-indigits5_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS6_WC, "ctype-indigits6_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS7_WC, "ctype-indigits7_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS8_WC, "ctype-indigits8_wc", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_INDIGITS9_WC, "ctype-indigits9_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS0_WC, "ctype-indigits0_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS1_WC, "ctype-indigits1_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS2_WC, "ctype-indigits2_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS3_WC, "ctype-indigits3_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS4_WC, "ctype-indigits4_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS5_WC, "ctype-indigits5_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS6_WC, "ctype-indigits6_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS7_WC, "ctype-indigits7_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS8_WC, "ctype-indigits8_wc", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS9_WC, "ctype-indigits9_wc", std, wstring)
DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT0_MB, "ctype-outdigit0_mb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT1_MB, "ctype-outdigit1_mb", std, string)
DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT2_MB, "ctype-outdigit2_mb", std, string)
@@ -123,12 +123,12 @@ DEFINE_CATEGORY
DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT8_WC, "ctype-outdigit8_wc", std, word)
DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT9_WC, "ctype-outdigit9_wc", std, word)
DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TAB_SIZE, "ctype-translit-tab-size", std, word)
- DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_FROM_IDX, "ctype-translit-from-idx", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_FROM_TBL, "ctype-translit-from-tbl", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TO_IDX, "ctype-translit-to-idx", std, string)
- DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TO_TBL, "ctype-translit-to-tbl", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_FROM_IDX, "ctype-translit-from-idx", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_FROM_TBL, "ctype-translit-from-tbl", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TO_IDX, "ctype-translit-to-idx", std, wstring)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TO_TBL, "ctype-translit-to-tbl", std, wstring)
DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN, "ctype-translit-default-missing-len", std, word)
- DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_DEFAULT_MISSING, "ctype-translit-default-missing", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_DEFAULT_MISSING, "ctype-translit-default-missing", std, wstring)
DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_IGNORE_LEN, "ctype-translit-ignore-len", std, word)
DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_IGNORE, "ctype-translit-ignore", std, string)
), _nl_postload_ctype)
@@ -214,25 +214,25 @@ DEFINE_CATEGORY
DEFINE_ELEMENT (ERA, "era", opt, stringarray)
DEFINE_ELEMENT (ERA_YEAR, "era_year", opt, string)
DEFINE_ELEMENT (ERA_D_FMT, "era_d_fmt", opt, string)
- DEFINE_ELEMENT (ALT_DIGITS, "alt_digits", opt, stringarray, 0, 100)
+ DEFINE_ELEMENT (ALT_DIGITS, "alt_digits", opt, stringlist, 100, 100)
DEFINE_ELEMENT (ERA_D_T_FMT, "era_d_t_fmt", opt, string)
DEFINE_ELEMENT (ERA_T_FMT, "era_t_fmt", opt, string)
DEFINE_ELEMENT (_NL_TIME_ERA_NUM_ENTRIES, "time-era-num-entries", opt, word)
DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES, "time-era-entries", opt, string)
- DEFINE_ELEMENT (_NL_WABDAY_1, "wide-abday", std, stringarray, 7, 7)
- DEFINE_ELEMENT (_NL_WDAY_1, "wide-day", std, stringarray, 7, 7)
- DEFINE_ELEMENT (_NL_WABMON_1, "wide-abmon", std, stringarray, 12, 12)
- DEFINE_ELEMENT (_NL_WMON_1, "wide-mon", std, stringarray, 12, 12)
- DEFINE_ELEMENT (_NL_WAM_STR, "wide-am_pm", std, stringarray, 2, 2)
- DEFINE_ELEMENT (_NL_WD_T_FMT, "wide-d_t_fmt", std, string)
- DEFINE_ELEMENT (_NL_WD_FMT, "wide-d_fmt", std, string)
- DEFINE_ELEMENT (_NL_WT_FMT, "wide-t_fmt", std, string)
- DEFINE_ELEMENT (_NL_WT_FMT_AMPM, "wide-t_fmt_ampm", std, string)
- DEFINE_ELEMENT (_NL_WERA_YEAR, "wide-era_year", opt, string)
- DEFINE_ELEMENT (_NL_WERA_D_FMT, "wide-era_d_fmt", opt, string)
- DEFINE_ELEMENT (_NL_WALT_DIGITS, "wide-alt_digits", opt, stringarray, 0, 100)
- DEFINE_ELEMENT (_NL_WERA_D_T_FMT, "wide-era_d_t_fmt", opt, string)
- DEFINE_ELEMENT (_NL_WERA_T_FMT, "wide-era_t_fmt", opt, string)
+ DEFINE_ELEMENT (_NL_WABDAY_1, "wide-abday", std, wstringarray, 7, 7)
+ DEFINE_ELEMENT (_NL_WDAY_1, "wide-day", std, wstringarray, 7, 7)
+ DEFINE_ELEMENT (_NL_WABMON_1, "wide-abmon", std, wstringarray, 12, 12)
+ DEFINE_ELEMENT (_NL_WMON_1, "wide-mon", std, wstringarray, 12, 12)
+ DEFINE_ELEMENT (_NL_WAM_STR, "wide-am_pm", std, wstringarray, 2, 2)
+ DEFINE_ELEMENT (_NL_WD_T_FMT, "wide-d_t_fmt", std, wstring)
+ DEFINE_ELEMENT (_NL_WD_FMT, "wide-d_fmt", std, wstring)
+ DEFINE_ELEMENT (_NL_WT_FMT, "wide-t_fmt", std, wstring)
+ DEFINE_ELEMENT (_NL_WT_FMT_AMPM, "wide-t_fmt_ampm", std, wstring)
+ DEFINE_ELEMENT (_NL_WERA_YEAR, "wide-era_year", opt, wstring)
+ DEFINE_ELEMENT (_NL_WERA_D_FMT, "wide-era_d_fmt", opt, wstring)
+ DEFINE_ELEMENT (_NL_WALT_DIGITS, "wide-alt_digits", opt, wstringlist, 1000, 100)
+ DEFINE_ELEMENT (_NL_WERA_D_T_FMT, "wide-era_d_t_fmt", opt, wstring)
+ DEFINE_ELEMENT (_NL_WERA_T_FMT, "wide-era_t_fmt", opt, wstring)
DEFINE_ELEMENT (_NL_TIME_WEEK_NDAYS, "week-ndays", std, byte)
DEFINE_ELEMENT (_NL_TIME_WEEK_1STDAY, "week-1stday", std, word)
DEFINE_ELEMENT (_NL_TIME_WEEK_1STWEEK, "week-1stweek", std, byte)
@@ -241,7 +241,7 @@ DEFINE_CATEGORY
DEFINE_ELEMENT (_NL_TIME_CAL_DIRECTION, "cal_direction", std, byte)
DEFINE_ELEMENT (_NL_TIME_TIMEZONE, "timezone", std, string)
DEFINE_ELEMENT (_DATE_FMT, "date_fmt", opt, string)
- DEFINE_ELEMENT (_NL_W_DATE_FMT, "wide-date_fmt", opt, string)
+ DEFINE_ELEMENT (_NL_W_DATE_FMT, "wide-date_fmt", opt, wstring)
), _nl_postload_time)
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index 1a4fe6f..984696e 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -91,7 +91,10 @@ enum value_type
bytearray,
word,
stringlist,
- wordarray
+ wordarray,
+ wstring,
+ wstringarray,
+ wstringlist
};
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 7a42f1e..0b61467 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)
diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h
index 50e296d..daf9273 100644
--- a/sysdeps/sparc/fpu/bits/mathinline.h
+++ b/sysdeps/sparc/fpu/bits/mathinline.h
@@ -100,11 +100,10 @@
/* The gcc, version 2.7 or below, has problems with all this inlining
code. So disable it for this version of the compiler. */
-
-# if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
+# if __GNUC_PREREQ (2, 8)
/* Test for negative number. Used in the signbit() macro. */
__MATH_INLINE int
-__signbitf (float __x)
+__signbitf (float __x) __THROW
{
__extension__ union { float __f; int __i; } __u = { __f: __x };
return __u.__i < 0;
@@ -113,14 +112,14 @@ __signbitf (float __x)
#if __WORDSIZE == 32
__MATH_INLINE int
-__signbit (double __x)
+__signbit (double __x) __THROW
{
__extension__ union { double __d; int __i[2]; } __u = { __d: __x };
return __u.__i[0] < 0;
}
__MATH_INLINE int
-__signbitl (long double __x)
+__signbitl (long double __x) __THROW
{
return __signbit ((double)__x);
}
@@ -128,14 +127,14 @@ __signbitl (long double __x)
#else /* sparc64 */
__MATH_INLINE int
-__signbit (double __x)
+__signbit (double __x) __THROW
{
__extension__ union { double __d; long __i; } __u = { __d: __x };
return __u.__i < 0;
}
__MATH_INLINE int
-__signbitl (long double __x)
+__signbitl (long double __x) __THROW
{
__extension__ union { long double __l; long __i[2]; } __u = { __l: __x };
return __u.__i[0] < 0;