]> pd.if.org Git - pdclib/blob - functions/ctype/toupper.c
PDCLIB-1 PDCLIB-2 PDCLIB-9 PDCLIB-12: Add thread specific locale support; migrate...
[pdclib] / functions / ctype / toupper.c
1 /* $Id$ */
2
3 /* toupper( 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 toupper( int c )
15 {
16     return _PDCLIB_threadlocale()->_CType[c].upper;
17 }
18
19 #endif
20
21 #ifdef TEST
22 #include <_PDCLIB_test.h>
23
24 int main( void )
25 {
26     TESTCASE( toupper( 'a' ) == 'A' );
27     TESTCASE( toupper( 'z' ) == 'Z' );
28     TESTCASE( toupper( 'A' ) == 'A' );
29     TESTCASE( toupper( 'Z' ) == 'Z' );
30     TESTCASE( toupper( '@' ) == '@' );
31     TESTCASE( toupper( '[' ) == '[' );
32     return TEST_RESULTS;
33 }
34 #endif