]> pd.if.org Git - pdclib/blob - functions/ctype/ispunct.c
Moved ctype info into struct lconv.
[pdclib] / functions / ctype / ispunct.c
1 /* $Id$ */
2
3 /* ispunct( 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 ispunct( int c )
16 {
17     return ( _PDCLIB_lconv.ctype[c].flags & _PDCLIB_CTYPE_PUNCT );
18 }
19
20 #endif
21
22 #ifdef TEST
23 #include <_PDCLIB_test.h>
24
25 int main( void )
26 {
27     TESTCASE( ! ispunct( 'a' ) );
28     TESTCASE( ! ispunct( 'z' ) );
29     TESTCASE( ! ispunct( 'A' ) );
30     TESTCASE( ! ispunct( 'Z' ) );
31     TESTCASE( ispunct( '@' ) );
32     TESTCASE( ispunct( '.' ) );
33     TESTCASE( ! ispunct( '\t' ) );
34     TESTCASE( ! ispunct( '\0' ) );
35     TESTCASE( ! ispunct( ' ' ) );
36     return TEST_RESULTS;
37 }
38
39 #endif