comparison libcommon/names.c @ 9:c9ef9e91dd8e

new libcommon, initial version
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Mar 2021 06:55:38 +0000
parents
children
comparison
equal deleted inserted replaced
8:34bbb0585cab 9:c9ef9e91dd8e
1 /*
2 * This module contains the table of user-friendly file names
3 * and a function for searching this table.
4 */
5
6 #include <string.h>
7 #include <strings.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include "file_id.h"
11
12 static struct nametab {
13 char *name;
14 int file_id;
15 } name_table[] = {
16 {"MF", FILEID_MF},
17 {"DF_GSM", DF_GSM},
18 {"DF_DCS1800", DF_DCS1800},
19 {"DF_TELECOM", DF_TELECOM},
20 {"gsm", DF_GSM},
21 {"telecom", DF_TELECOM},
22 /* EFs under MF */
23 {"EF_DIR", EF_DIR},
24 {"EF_ICCID", EF_ICCID},
25 /* EFs under DF_GSM */
26 {"EF_LP", EF_LP},
27 {"EF_IMSI", EF_IMSI},
28 {"EF_Kc", EF_Kc},
29 {"EF_PLMNsel", EF_PLMNsel},
30 {"EF_HPLMN", EF_HPLMN},
31 {"EF_ACMmax", EF_ACMmax},
32 {"EF_SST", EF_SST},
33 {"EF_ACM", EF_ACM},
34 {"EF_GID1", EF_GID1},
35 {"EF_GID2", EF_GID2},
36 {"EF_PUCT", EF_PUCT},
37 {"EF_CBMI", EF_CBMI},
38 {"EF_SPN", EF_SPN},
39 {"EF_CBMID", EF_CBMID},
40 {"EF_CBMIR", EF_CBMIR},
41 {"EF_BCCH", EF_BCCH},
42 {"EF_ACC", EF_ACC},
43 {"EF_FPLMN", EF_FPLMN},
44 {"EF_LOCI", EF_LOCI},
45 {"EF_AD", EF_AD},
46 {"EF_PHASE", EF_PHASE},
47 {"EF_ECC", EF_ECC},
48 {"EF_PNN", EF_PNN},
49 {"EF_OPL", EF_OPL},
50 {"EF_MBDN", EF_MBDN},
51 {"EF_MBI", EF_MBI},
52 {"EF_MWIS", EF_MWIS},
53 /* EFs under DF_TELECOM */
54 {"EF_ADN", EF_ADN},
55 {"EF_FDN", EF_FDN},
56 {"EF_SMS", EF_SMS},
57 {"EF_CCP", EF_CCP},
58 {"EF_MSISDN", EF_MSISDN},
59 {"EF_SMSP", EF_SMSP},
60 {"EF_SMSS", EF_SMSS},
61 {"EF_LND", EF_LND},
62 {"EF_SDN", EF_SDN},
63 {"EF_EXT1", EF_EXT1},
64 {"EF_EXT2", EF_EXT2},
65 {"EF_EXT3", EF_EXT3},
66 /* table search terminator */
67 {0, -1}
68 };
69
70 find_symbolic_file_name(soughtname)
71 char *soughtname;
72 {
73 struct nametab *tp;
74
75 for (tp = name_table; tp->name; tp++)
76 if (!strcmp(tp->name, soughtname))
77 break;
78 return tp->file_id;
79 }