about summary refs log tree commit diff
path: root/wctype/wctype.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-08 19:53:27 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-08 19:53:27 +0000
commit49f2be5b0eea30507a77e9467d0ef2c697953bca (patch)
treef288b420d8564f4f24214b35c2703fbfc7e29fb8 /wctype/wctype.h
parent85cb60ffd7585e71a3d53451d0b7f0fba4e4122f (diff)
downloadglibc-49f2be5b0eea30507a77e9467d0ef2c697953bca.tar.gz
glibc-49f2be5b0eea30507a77e9467d0ef2c697953bca.tar.xz
glibc-49f2be5b0eea30507a77e9467d0ef2c697953bca.zip
Update.
	* ctype/Versions: Add __ctype32_tolower and __ctype32_toupper.
	* ctype/ctype-info.c: Define __ctype32_tolower and __ctype32_toupper.
	* locale/C-ctype.c: Add _nl_C_LC_CTYPE_toupper32 and
	_nl_C_LC_CTYPE_tolower32 tables.
	Don't compile it names of 14652 classes and maps.
	* locale/langinfo.h: Define _NL_CTYPE_TOUPPER32 and
	_NL_CTYPE_TOLOWER32.
	* locale/lc-ctype.c (_nl_postload_ctype): Initialize __ctype32_toupper
	and __ctype32_tolower.
	* locale/programs/ld-ctype.c (struct locale_ctype_t): Add map32.
	(ctype_output): Write out map32 values.
	(allocate_arrays): Compute mapping tables correctly.
	* wctype/wcfuncs.c (towlower): Use __ctype32_tolower.
	(towupper): Use __ctype32_toupper.
	* wctype/wctype.h: Optimize towupper and towlower for values < 256.
Diffstat (limited to 'wctype/wctype.h')
-rw-r--r--wctype/wctype.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/wctype/wctype.h b/wctype/wctype.h
index 378095bcb4..2a4caddd90 100644
--- a/wctype/wctype.h
+++ b/wctype/wctype.h
@@ -238,6 +238,22 @@ extern wint_t towupper (wint_t __wc) __THROW;
 /* Map the wide character WC using the mapping described by DESC.  */
 extern wint_t __towctrans (wint_t __wc, wctrans_t __desc) __THROW;
 
+#if __GNUC__ >= 2 && defined __OPTIMIZE__
+/* The tables are always organized in a way which allows direct access
+   for single byte characters.  */
+extern const wint_t *__ctype32_tolower;
+extern const wint_t *__ctype32_toupper;
+
+# define towlower(wc) \
+  (__builtin_constant_p (wc) && (wc) >= L'\0' && (wc) <= L'\xff'	      \
+   ? (wint_t) __ctype32_tolower[wc] : towlower (wc))
+
+# define towupper(wc) \
+  (__builtin_constant_p (wc) && (wc) >= L'\0' && (wc) <= L'\xff'	      \
+   ? (wint_t) __ctype32_toupper[wc] : towupper (wc))
+
+#endif	/* gcc && optimizing */
+
 __END_DECLS
 
 #endif	/* need iswxxx.  */