]> pd.if.org Git - pdclib/blob - functions/wctype/towlower.c
Cosmetic comment fixes.
[pdclib] / functions / wctype / towlower.c
1 /* towlower( wint_t )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <wctype.h>
8 #ifndef REGTEST
9 #include "_PDCLIB_locale.h"
10
11 wint_t _PDCLIB_towlower_l( wint_t wc, locale_t l )
12 {
13     wint_t uwc = _PDCLIB_unpackwint( wc );
14     _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc );
15     if( info ) 
16     {
17         uwc += info->lower_delta;
18     }
19     return uwc;
20 }
21
22 wint_t towlower( wint_t wc )
23 {
24     return _PDCLIB_towlower_l( wc, _PDCLIB_threadlocale() );
25 }
26
27 #endif
28
29 #ifdef TEST
30 #include "_PDCLIB_test.h"
31
32 int main( void )
33 {
34     TESTCASE(towlower(0) == 0);
35     TESTCASE(towlower(L'a') == L'a');
36     TESTCASE(towlower(L'B') == L'b');
37     TESTCASE(towlower(L'0') == L'0');
38
39     return TEST_RESULTS;
40 }
41 #endif