]> pd.if.org Git - pdclib/blob - functions/ctype/tolower.c
a77001ef8e687fdbbddd10209e8d9fc94f9b1690
[pdclib] / functions / ctype / tolower.c
1 /* $Id$ */
2
3 /* tolower( int )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 #include <ctype.h>
10
11 #ifndef REGTEST
12 #include <_PDCLIB_locale.h>
13
14 int tolower( int c )
15 {
16     return _PDCLIB_threadlocale()->_CType[c].lower;
17 }
18
19 #endif
20
21 #ifdef TEST
22 #include <_PDCLIB_test.h>
23
24 int main( void )
25 {
26     TESTCASE( tolower( 'A' ) == 'a' );
27     TESTCASE( tolower( 'Z' ) == 'z' );
28     TESTCASE( tolower( 'a' ) == 'a' );
29     TESTCASE( tolower( 'z' ) == 'z' );
30     TESTCASE( tolower( '@' ) == '@' );
31     TESTCASE( tolower( '[' ) == '[' );
32     return TEST_RESULTS;
33 }
34 #endif