FreeCalypso > hg > freecalypso-hwlab
annotate simtool/names.c @ 89:fb75855a74a9
fc-simtool: select response parsing: show number of records
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 Jan 2021 18:03:55 +0000 |
parents | 2a0d1d5b9313 |
children | 7e7eab9ea7c5 |
rev | line source |
---|---|
87
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module contains the table of user-friendly file names |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * and a function for searching this table. |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <string.h> |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <strings.h> |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <stdio.h> |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <stdlib.h> |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include "file_id.h" |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 static struct nametab { |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 char *name; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 int file_id; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 } name_table[] = { |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 {"MF", FILEID_MF}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 {"DF_GSM", DF_GSM}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 {"DF_DCS1800", DF_DCS1800}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 {"DF_TELECOM", DF_TELECOM}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 {"gsm", DF_GSM}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 {"telecom", DF_TELECOM}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 /* EFs under MF */ |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 {"EF_ICCID", EF_ICCID}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 /* EFs under DF_GSM */ |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 {"EF_LP", EF_LP}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 {"EF_IMSI", EF_IMSI}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 {"EF_Kc", EF_Kc}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 {"EF_PLMNsel", EF_PLMNsel}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 {"EF_HPLMN", EF_HPLMN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 {"EF_ACMmax", EF_ACMmax}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 {"EF_SST", EF_SST}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 {"EF_ACM", EF_ACM}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 {"EF_GID1", EF_GID1}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 {"EF_GID2", EF_GID2}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 {"EF_PUCT", EF_PUCT}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 {"EF_CBMI", EF_CBMI}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 {"EF_SPN", EF_SPN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 {"EF_CBMID", EF_CBMID}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 {"EF_CBMIR", EF_CBMIR}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 {"EF_BCCH", EF_BCCH}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 {"EF_ACC", EF_ACC}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 {"EF_FPLMN", EF_FPLMN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 {"EF_LOCI", EF_LOCI}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 {"EF_AD", EF_AD}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 {"EF_PHASE", EF_PHASE}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 {"EF_ECC", EF_ECC}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 /* EFs under DF_TELECOM */ |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 {"EF_ADN", EF_ADN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 {"EF_FDN", EF_FDN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 {"EF_SMS", EF_SMS}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 {"EF_CCP", EF_CCP}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 {"EF_MSISDN", EF_MSISDN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 {"EF_SMSP", EF_SMSP}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 {"EF_SMSS", EF_SMSS}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 {"EF_LND", EF_LND}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 {"EF_SDN", EF_SDN}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 {"EF_EXT1", EF_EXT1}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 {"EF_EXT2", EF_EXT2}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 {"EF_EXT3", EF_EXT3}, |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 /* table search terminator */ |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 {0, -1} |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 }; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 find_symbolic_file_name(soughtname) |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 char *soughtname; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 { |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 struct nametab *tp; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 for (tp = name_table; tp->name; tp++) |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 if (!strcmp(tp->name, soughtname)) |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 break; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 return tp->file_id; |
2a0d1d5b9313
fc-simtool: symbolic file names implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 } |