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