# HG changeset patch # User Mychaela Falconia # Date 1517702000 0 # Node ID 74d5e95ee84a1975c2c586e04ab3b557fdb6161b # Parent ea41b6001848b325fa32ad84c790407be5c3fffc uptools/libcoding: alphabetic address handling implemented diff -r ea41b6001848 -r 74d5e95ee84a uptools/libcoding/Makefile --- a/uptools/libcoding/Makefile Sat Feb 03 22:57:45 2018 +0000 +++ b/uptools/libcoding/Makefile Sat Feb 03 23:53:20 2018 +0000 @@ -1,7 +1,7 @@ CC= gcc CFLAGS= -O2 -OBJS= decode_helpers.o gsm7_decode.o gsm7_decode_tables.o gsm7_unpack.o \ - hexdecode.o number_decode.o scaddr.o ucs2_decode.o +OBJS= alpha_addr.o decode_helpers.o gsm7_decode.o gsm7_decode_tables.o \ + gsm7_unpack.o hexdecode.o number_decode.o scaddr.o ucs2_decode.o LIB= libcoding.a all: ${LIB} diff -r ea41b6001848 -r 74d5e95ee84a uptools/libcoding/alpha_addr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uptools/libcoding/alpha_addr.c Sat Feb 03 23:53:20 2018 +0000 @@ -0,0 +1,21 @@ +/* + * This library module contains some bits that help working with + * alphabetic addresses. + */ + +#include + +u_char alpha_septets_to_digits[12] = {0, 2, 4, 6, 7, 9, 11, 13, 14, 16, 18, 20}; + +alpha_addr_valid(ndigits, sepp) + unsigned ndigits, *sepp; +{ + unsigned n; + + for (n = 1; n <= 11; n++) + if (alpha_septets_to_digits[n] == ndigits) { + *sepp = n; + return(1); + } + return(0); +}