]> pd.if.org Git - pdclib/blob - functions/ctype/isxdigit.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / ctype / isxdigit.c
1 /* isxdigit( 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 isxdigit( int c )
13 {
14     return ( _PDCLIB_threadlocale()->_CType[c].flags & _PDCLIB_CTYPE_XDIGT );
15 }
16
17 #endif
18
19 #ifdef TEST
20 #include "_PDCLIB_test.h"
21
22 int main( void )
23 {
24     TESTCASE( isxdigit( '0' ) );
25     TESTCASE( isxdigit( '9' ) );
26     TESTCASE( isxdigit( 'a' ) );
27     TESTCASE( isxdigit( 'f' ) );
28     TESTCASE( ! isxdigit( 'g' ) );
29     TESTCASE( isxdigit( 'A' ) );
30     TESTCASE( isxdigit( 'F' ) );
31     TESTCASE( ! isxdigit( 'G' ) );
32     TESTCASE( ! isxdigit( '@' ) );
33     TESTCASE( ! isxdigit( ' ' ) );
34     return TEST_RESULTS;
35 }
36
37 #endif