comparison uptools/libcoding/alpha_addr.c @ 333:74d5e95ee84a

uptools/libcoding: alphabetic address handling implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 03 Feb 2018 23:53:20 +0000
parents
children
comparison
equal deleted inserted replaced
332:ea41b6001848 333:74d5e95ee84a
1 /*
2 * This library module contains some bits that help working with
3 * alphabetic addresses.
4 */
5
6 #include <sys/types.h>
7
8 u_char alpha_septets_to_digits[12] = {0, 2, 4, 6, 7, 9, 11, 13, 14, 16, 18, 20};
9
10 alpha_addr_valid(ndigits, sepp)
11 unsigned ndigits, *sepp;
12 {
13 unsigned n;
14
15 for (n = 1; n <= 11; n++)
16 if (alpha_septets_to_digits[n] == ndigits) {
17 *sepp = n;
18 return(1);
19 }
20 return(0);
21 }