1 /*****************************************************************************
2 
3 	IsRadx()
4 
5 	This function returns TRUE if the argument is a valid digit in the
6 current radix.
7 
8 *****************************************************************************/
9 
10 #include "zport.h"		/* define portability identifiers */
11 #include "tecoc.h"		/* define general identifiers */
12 #include "defext.h"		/* define external global variables */
13 #include "chmacs.h"		/* define character processing macros */
14 
IsRadx(Charac)15 BOOLEAN	IsRadx(Charac)		/* is Charac in the radix set? */
16 unsigned char Charac;
17 {
18 	if (Charac < '0') {
19 		return FALSE;
20 	}
21 
22 	if (Charac <= '9') {
23 		Charac -= '0';
24 	} else if (Is_Lower(Charac)) {
25 		Charac -= ('a' - 10);
26 	} else if (Is_Upper(Charac)) {
27 		Charac -= ('A' - 10);
28 	} else {
29 		return FALSE;
30 	}
31 
32 	return Charac < Radix;
33 }
34