changeset 9:0b4d54289ef3

themwi-short-dial compiles in the new model
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 13 Dec 2023 03:51:57 +0000
parents db3c657efafa
children 05a94b08c8e1
files .hgignore utils/Makefile utils/themwi-short-dial.c
diffstat 3 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Dec 13 03:39:48 2023 +0000
+++ b/.hgignore	Wed Dec 13 03:51:57 2023 +0000
@@ -4,4 +4,5 @@
 
 ^utils/themwi-check-own$
 ^utils/themwi-dump-numdb$
+^utils/themwi-short-dial$
 ^utils/themwi-update-numdb$
--- a/utils/Makefile	Wed Dec 13 03:39:48 2023 +0000
+++ b/utils/Makefile	Wed Dec 13 03:51:57 2023 +0000
@@ -1,6 +1,6 @@
 CC=	gcc
 CFLAGS=	-O2 -I../build-inc
-PROGS=	themwi-check-own themwi-dump-numdb themwi-update-numdb
+PROGS=	themwi-check-own themwi-dump-numdb themwi-short-dial themwi-update-numdb
 LIBNUMDB=../libnumdb/libnumdb.a
 LIBUTIL=../libnumutil/libnumutil.a
 
@@ -12,6 +12,9 @@
 themwi-dump-numdb:	themwi-dump-numdb.c
 	${CC} ${CFLAGS} -o $@ $@.c
 
+themwi-short-dial:	themwi-short-dial.o ${LIBNUMDB} ${LIBUTIL}
+	${CC} -o $@ $@.o ${LIBNUMDB} ${LIBUTIL}
+
 themwi-update-numdb:	themwi-update-numdb.o ${LIBUTIL}
 	${CC} -o $@ $@.o ${LIBUTIL}
 
--- a/utils/themwi-short-dial.c	Wed Dec 13 03:39:48 2023 +0000
+++ b/utils/themwi-short-dial.c	Wed Dec 13 03:51:57 2023 +0000
@@ -8,13 +8,14 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <syslog.h>
-#include "../include/number_db_v2.h"
-#include "../libnumdb2/lookup_func.h"
 
-main(argc, argv)
-	char **argv;
+#include <themwi/nanp/number_db_v2.h>
+#include <themwi/nanp/number_lookup.h>
+#include <themwi/nanp/number_utils.h>
+
+int main(int argc, char **argv)
 {
-	struct short_number_rec *rec;
+	const struct short_number_rec *rec;
 
 	if (argc != 2) {
 usage:		fprintf(stderr, "usage: %s 4-digit-number\n", argv[0]);
@@ -22,7 +23,7 @@
 	}
 	if (grok_number_string(argv[1], 0) != 4)
 		goto usage;
-	openlog("themwi-short-dial", 0, LOG_LOCAL5);
+	openlog("themwi-short-dial", LOG_PERROR, LOG_USER);
 	if (read_number_db() < 0) {
 		fprintf(stderr, "error reading number database\n");
 		exit(1);