]> pd.if.org Git - pdclib/blobdiff - functions/wctype/towlower.c
Revert reordering of declarations; for easier tracking of upstream changes.
[pdclib] / functions / wctype / towlower.c
index 7f9809c32af356208ffe5743960a4e448c6f5cbb..666bf6b53e4e69bb0835cb6f26ca2249e1d24e50 100644 (file)
@@ -6,23 +6,28 @@
 \r
 #include <wctype.h>\r
 #ifndef REGTEST\r
-#include <_PDCLIB_locale.h>\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
 \r
 #ifdef TEST\r
-#include <_PDCLIB_test.h>\r
+#include "_PDCLIB_test.h"\r
 \r
 int main( void )\r
 {\r