X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fwctype%2Ftowlower.c;h=b81e7579cada4b747f44b1cb902cbc34b54ba959;hp=666bf6b53e4e69bb0835cb6f26ca2249e1d24e50;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/functions/wctype/towlower.c b/functions/wctype/towlower.c index 666bf6b..b81e757 100644 --- a/functions/wctype/towlower.c +++ b/functions/wctype/towlower.c @@ -1,41 +1,41 @@ -/* towlower( wint_t ) - - This file is part of the Public Domain C Library (PDCLib). - Permission is granted to use, modify, and / or redistribute at will. -*/ - -#include -#ifndef REGTEST -#include "_PDCLIB_locale.h" - -wint_t _PDCLIB_towlower_l( wint_t wc, locale_t l ) -{ - wint_t uwc = _PDCLIB_unpackwint( wc ); - _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc ); - if( info ) - { - uwc += info->lower_delta; - } - return uwc; -} - -wint_t towlower( wint_t wc ) -{ - return _PDCLIB_towlower_l( wc, _PDCLIB_threadlocale() ); -} - -#endif - -#ifdef TEST -#include "_PDCLIB_test.h" - -int main( void ) -{ - TESTCASE(towlower(0) == 0); - TESTCASE(towlower(L'a') == L'a'); - TESTCASE(towlower(L'B') == L'b'); - TESTCASE(towlower(L'0') == L'0'); - - return TEST_RESULTS; -} -#endif +/* towlower( wint_t ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#ifndef REGTEST +#include "_PDCLIB_locale.h" + +wint_t _PDCLIB_towlower_l( wint_t wc, locale_t l ) +{ + wint_t uwc = _PDCLIB_unpackwint( wc ); + _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc ); + if( info ) + { + uwc += info->lower_delta; + } + return uwc; +} + +wint_t towlower( wint_t wc ) +{ + return _PDCLIB_towlower_l( wc, _PDCLIB_threadlocale() ); +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + TESTCASE(towlower(0) == 0); + TESTCASE(towlower(L'a') == L'a'); + TESTCASE(towlower(L'B') == L'b'); + TESTCASE(towlower(L'0') == L'0'); + + return TEST_RESULTS; +} +#endif