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