FreeCalypso > hg > themwi-nanp
comparison utils/themwi-dump-numdb.c @ 5:2729f94f38fb
themwi-dump-numdb compiles in the new model
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 13 Dec 2023 02:53:27 +0000 |
parents | b280d93e8bc1 |
children |
comparison
equal
deleted
inserted
replaced
4:b280d93e8bc1 | 5:2729f94f38fb |
---|---|
4 */ | 4 */ |
5 | 5 |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include "../include/number_db_v2.h" | |
10 | 9 |
11 static char binfile_default_pathname[] = "/var/gsm/number-db2.bin"; | 10 #include <themwi/nanp/number_db_v2.h> |
12 static char *binfile_pathname; | 11 |
12 static const char binfile_default_pathname[] = "/var/gsm/number-db2.bin"; | |
13 static const char *binfile_pathname; | |
13 static FILE *inf; | 14 static FILE *inf; |
14 static struct numdb_file_hdr hdr; | 15 static struct numdb_file_hdr hdr; |
15 | 16 |
16 static void | 17 static void dump_owned_numbers(void) |
17 dump_owned_numbers() | |
18 { | 18 { |
19 unsigned count; | 19 unsigned count; |
20 struct owned_number_rec rec; | 20 struct owned_number_rec rec; |
21 | 21 |
22 for (count = 0; count < hdr.owned_number_count; count++) { | 22 for (count = 0; count < hdr.owned_number_count; count++) { |
36 printf(" E911 route via: %03u-%03u-%04u\n", | 36 printf(" E911 route via: %03u-%03u-%04u\n", |
37 rec.remap[0], rec.remap[1], rec.remap[2]); | 37 rec.remap[0], rec.remap[1], rec.remap[2]); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 static void | 41 static void dump_short_numbers(void) |
42 dump_short_numbers() | |
43 { | 42 { |
44 unsigned count; | 43 unsigned count; |
45 struct short_number_rec rec; | 44 struct short_number_rec rec; |
46 | 45 |
47 for (count = 0; count < hdr.short_number_count; count++) { | 46 for (count = 0; count < hdr.short_number_count; count++) { |
59 rec.short_num, rec.fullnum_flags); | 58 rec.short_num, rec.fullnum_flags); |
60 } | 59 } |
61 } | 60 } |
62 } | 61 } |
63 | 62 |
64 main(argc, argv) | 63 int main(int argc, char **argv) |
65 char **argv; | |
66 { | 64 { |
67 if (argc > 2) { | 65 if (argc > 2) { |
68 fprintf(stderr, "usage: %s [binfile]\n", argv[0]); | 66 fprintf(stderr, "usage: %s [binfile]\n", argv[0]); |
69 exit(1); | 67 exit(1); |
70 } | 68 } |