FreeCalypso > hg > themwi-system-sw
view libutil/nanp_valid.c @ 209:e80f158333c5
mgw: correct PCMU decoding table
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 07 May 2023 21:43:02 -0800 |
parents | b1c364729a93 |
children | 81958b35f74d |
line wrap: on
line source
/* * Utility functions for NANP number validation. */ is_nanp_valid_prefix(s) char *s; { /* validate NPA part */ if (s[0] < '2') return(0); if (s[1] == '1' && s[2] == '1') return(0); if (s[1] == '9') return(0); /* validate exchange part */ if (s[3] < '2') return(0); if (s[4] == '1' && s[5] == '1') return(0); /* all checks passed */ return(1); }