changeset 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 1e548c7a24a1
files .hgignore utils/Makefile utils/themwi-dump-numdb.c
diffstat 3 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Dec 13 02:18:07 2023 +0000
+++ b/.hgignore	Wed Dec 13 02:53:27 2023 +0000
@@ -2,4 +2,5 @@
 
 \.[oa]$
 
+^utils/themwi-dump-numdb$
 ^utils/themwi-update-numdb$
--- a/utils/Makefile	Wed Dec 13 02:18:07 2023 +0000
+++ b/utils/Makefile	Wed Dec 13 02:53:27 2023 +0000
@@ -1,11 +1,14 @@
 CC=	gcc
 CFLAGS=	-O2 -I../build-inc
-PROGS=	themwi-update-numdb
+PROGS=	themwi-dump-numdb themwi-update-numdb
 LIBNUMDB=../libnumdb/libnumdb.a
 LIBUTIL=../libnumutil/libnumutil.a
 
 all:	${PROGS}
 
+themwi-dump-numdb:	themwi-dump-numdb.c
+	${CC} ${CFLAGS} -o $@ $@.c
+
 themwi-update-numdb:	themwi-update-numdb.o ${LIBUTIL}
 	${CC} -o $@ $@.o ${LIBUTIL}
 
--- a/utils/themwi-dump-numdb.c	Wed Dec 13 02:18:07 2023 +0000
+++ b/utils/themwi-dump-numdb.c	Wed Dec 13 02:53:27 2023 +0000
@@ -6,15 +6,15 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include "../include/number_db_v2.h"
+
+#include <themwi/nanp/number_db_v2.h>
 
-static char binfile_default_pathname[] = "/var/gsm/number-db2.bin";
-static char *binfile_pathname;
+static const char binfile_default_pathname[] = "/var/gsm/number-db2.bin";
+static const char *binfile_pathname;
 static FILE *inf;
 static struct numdb_file_hdr hdr;
 
-static void
-dump_owned_numbers()
+static void dump_owned_numbers(void)
 {
 	unsigned count;
 	struct owned_number_rec rec;
@@ -38,8 +38,7 @@
 	}
 }
 
-static void
-dump_short_numbers()
+static void dump_short_numbers(void)
 {
 	unsigned count;
 	struct short_number_rec rec;
@@ -61,8 +60,7 @@
 	}
 }
 
-main(argc, argv)
-	char **argv;
+int main(int argc, char **argv)
 {
 	if (argc > 2) {
 		fprintf(stderr, "usage: %s [binfile]\n", argv[0]);