comparison libcoding/scaddr.c @ 27:7418ca2e9949

libcoding: add functions from freecalypso-tools/uptools/libcoding that are needed for sms-pdu-decode & pcm-sms-decode
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 Jun 2024 02:29:29 +0000
parents
children
comparison
equal deleted inserted replaced
26:c8cb05b69118 27:7418ca2e9949
1 /*
2 * This library module contains the code that figures out how many digits
3 * are there in a PDU-encoded Service Centre address.
4 */
5
6 #include <sys/types.h>
7
8 sc_addr_ndigits(sca)
9 u_char *sca;
10 {
11 unsigned nb, nd;
12
13 nb = sca[0];
14 nd = (nb - 1) * 2;
15 if ((sca[nb] & 0xF0) == 0xF0)
16 nd--;
17 return nd;
18 }