X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fwctype%2Ftowupper.c;h=368ca2cdb526e32bc3b9c6d4e9f27e6fe296eb76;hp=e9f99a54380791176a7a47dba0db075e6af1409a;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=abe63836320730ecf705e5da9c140db4c216cd2c diff --git a/functions/wctype/towupper.c b/functions/wctype/towupper.c index e9f99a5..368ca2c 100644 --- a/functions/wctype/towupper.c +++ b/functions/wctype/towupper.c @@ -1,41 +1,41 @@ -/* towupper( 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_towupper_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->upper_delta; - } - return uwc; -} - -wint_t towupper( wint_t wc ) -{ - return _PDCLIB_towupper_l( wc, _PDCLIB_threadlocale() ); -} - -#endif - -#ifdef TEST -#include <_PDCLIB_test.h> - -int main( void ) -{ - TESTCASE(towupper(0) == 0); - TESTCASE(towupper(L'a') == L'A'); - TESTCASE(towupper(L'B') == L'B'); - TESTCASE(towupper(L'0') == L'0'); - - return TEST_RESULTS; -} -#endif +/* towupper( 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_towupper_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->upper_delta; + } + return uwc; +} + +wint_t towupper( wint_t wc ) +{ + return _PDCLIB_towupper_l( wc, _PDCLIB_threadlocale() ); +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + TESTCASE(towupper(0) == 0); + TESTCASE(towupper(L'a') == L'A'); + TESTCASE(towupper(L'B') == L'B'); + TESTCASE(towupper(L'0') == L'0'); + + return TEST_RESULTS; +} +#endif