comparison libutil/extdigits.c @ 20:b13acb024fc6

libutil: add is_valid_ext_digit()
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 26 Jun 2022 23:35:19 -0800
parents
children
comparison
equal deleted inserted replaced
19:40e5097437fa 20:b13acb024fc6
1 /*
2 * The library function implemented in this module checks "extended"
3 * number digits, i.e., checks whether or not a given character
4 * makes a valid "extended" number digit.
5 */
6
7 is_valid_ext_digit(c)
8 {
9 switch (c) {
10 case '0':
11 case '1':
12 case '2':
13 case '3':
14 case '4':
15 case '5':
16 case '6':
17 case '7':
18 case '8':
19 case '9':
20 case '*':
21 case '#':
22 case 'a':
23 case 'b':
24 case 'c':
25 return(1);
26 default:
27 return(0);
28 }
29 }