]> pd.if.org Git - pdclib/blob - functions/ctype/isspace.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / ctype / isspace.c
1 /* isspace( int )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <ctype.h>
8
9 #ifndef REGTEST
10 #include "_PDCLIB_locale.h"
11
12 int isspace( int c )
13 {
14     return ( _PDCLIB_threadlocale()->_CType[c].flags & _PDCLIB_CTYPE_SPACE );
15 }
16
17 #endif
18
19 #ifdef TEST
20 #include "_PDCLIB_test.h"
21
22 int main( void )
23 {
24     TESTCASE( isspace( ' ' ) );
25     TESTCASE( isspace( '\f' ) );
26     TESTCASE( isspace( '\n' ) );
27     TESTCASE( isspace( '\r' ) );
28     TESTCASE( isspace( '\t' ) );
29     TESTCASE( isspace( '\v' ) );
30     TESTCASE( ! isspace( 'a' ) );
31     return TEST_RESULTS;
32 }
33
34 #endif