On altos, the primitive input function is ao_getchar, not getchar
[fw/pdclib] / platform / altos / 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
13 #include <locale.h>
14
15 int isspace( int c )
16 {
17         switch (c) {
18         case ' ':
19         case '\f':
20         case '\n':
21         case '\r':
22         case '\t':
23         case '\v':
24                 return 1;
25         }
26         return 0;
27 }
28
29 #endif
30
31 #ifdef TEST
32 #include <_PDCLIB_test.h>
33
34 int main( void )
35 {
36     TESTCASE( isspace( ' ' ) );
37     TESTCASE( isspace( '\f' ) );
38     TESTCASE( isspace( '\n' ) );
39     TESTCASE( isspace( '\r' ) );
40     TESTCASE( isspace( '\t' ) );
41     TESTCASE( isspace( '\v' ) );
42     TESTCASE( ! isspace( 'a' ) );
43     return TEST_RESULTS;
44 }
45
46 #endif