X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fwctype%2Ftowlower.c;h=666bf6b53e4e69bb0835cb6f26ca2249e1d24e50;hb=8894c921674bb116d0a7b8f23a55311e7a768019;hp=7f9809c32af356208ffe5743960a4e448c6f5cbb;hpb=75bf0c22663cec60d8164c8cf77e855a8b6ad459;p=pdclib diff --git a/functions/wctype/towlower.c b/functions/wctype/towlower.c index 7f9809c..666bf6b 100644 --- a/functions/wctype/towlower.c +++ b/functions/wctype/towlower.c @@ -6,23 +6,28 @@ #include #ifndef REGTEST -#include <_PDCLIB_locale.h> +#include "_PDCLIB_locale.h" -wint_t towlower( wint_t wc ) +wint_t _PDCLIB_towlower_l( wint_t wc, locale_t l ) { wint_t uwc = _PDCLIB_unpackwint( wc ); - _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc ); - if( info && info->lower != uwc ) + _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc ); + if( info ) { - wc = info->lower; + uwc += info->lower_delta; } - return wc; + return uwc; +} + +wint_t towlower( wint_t wc ) +{ + return _PDCLIB_towlower_l( wc, _PDCLIB_threadlocale() ); } #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" int main( void ) {