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 11 #include <locale.h> 12 isxdigit(int c)13int isxdigit( int c ) 14 { 15 return ( isdigit( c ) || 16 ( c >= _PDCLIB_lc_ctype->Xdigits_low && c <= _PDCLIB_lc_ctype->Xdigits_high ) || 17 ( c >= _PDCLIB_lc_ctype->xdigits_low && c <= _PDCLIB_lc_ctype->xdigits_high ) 18 ); 19 } 20 21 #endif 22 23 #ifdef TEST 24 25 #include "_PDCLIB_test.h" 26 main(void)27int main( void ) 28 { 29 TESTCASE( isxdigit( '0' ) ); 30 TESTCASE( isxdigit( '9' ) ); 31 TESTCASE( isxdigit( 'a' ) ); 32 TESTCASE( isxdigit( 'f' ) ); 33 TESTCASE( ! isxdigit( 'g' ) ); 34 TESTCASE( isxdigit( 'A' ) ); 35 TESTCASE( isxdigit( 'F' ) ); 36 TESTCASE( ! isxdigit( 'G' ) ); 37 TESTCASE( ! isxdigit( '@' ) ); 38 TESTCASE( ! isxdigit( ' ' ) ); 39 return TEST_RESULTS; 40 } 41 42 #endif 43