]> pd.if.org Git - pdclib/blob - functions/ctype/isalpha.c
147fd5eb14e82b4ab59f991dcdacb5d6b2f897f6
[pdclib] / functions / ctype / isalpha.c
1 /* $Id$ */
2
3 /* isalpha( 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 isalpha( int c )
15 {
16     return ( _PDCLIB_threadlocale()->_CType[c].flags & _PDCLIB_CTYPE_ALPHA );
17 }
18
19 #endif
20
21 #ifdef TEST
22 #include <_PDCLIB_test.h>
23
24 int main( void )
25 {
26     TESTCASE( isalpha( 'a' ) );
27     TESTCASE( isalpha( 'z' ) );
28     TESTCASE( ! isalpha( ' ' ) );
29     TESTCASE( ! isalpha( '1' ) );
30     TESTCASE( ! isalpha( '@' ) );
31     return TEST_RESULTS;
32 }
33
34 #endif