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