]> pd.if.org Git - pdclib.old/blobdiff - functions/wctype/towlower.c
Compress the Unicode data into runs. This results in a significant size reduction.
[pdclib.old] / functions / wctype / towlower.c
index 7f9809c32af356208ffe5743960a4e448c6f5cbb..b3def775b75b101992fc75752df8959c675e2b0e 100644 (file)
@@ -8,15 +8,20 @@
 #ifndef REGTEST\r
 #include <_PDCLIB_locale.h>\r
 \r
-wint_t towlower( wint_t wc )\r
+wint_t _PDCLIB_towlower_l( wint_t wc, locale_t l )\r
 {\r
     wint_t uwc = _PDCLIB_unpackwint( wc );\r
-    _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc );\r
-    if( info && info->lower != uwc \r
+    _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc );\r
+    if( info ) \r
     {\r
-        wc = info->lower;\r
+        uwc += info->lower_delta;\r
     }\r
-    return wc;\r
+    return uwc;\r
+}\r
+\r
+wint_t towlower( wint_t wc )\r
+{\r
+    return _PDCLIB_towlower_l( wc, _PDCLIB_threadlocale() );\r
 }\r
 \r
 #endif\r