summaryrefslogtreecommitdiffstats
path: root/usr.sbin/smtpd/table_static.c
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2018-12-27 09:30:29 +0000
committereric <eric@openbsd.org>2018-12-27 09:30:29 +0000
commit9a2428ac8f9eeb51f3d6df241a525f2af69d86c0 (patch)
tree4c117174b73ef7aa6b122591e0b3189a5feaa8b8 /usr.sbin/smtpd/table_static.c
parentchange the close() method to take the table pointer (diff)
downloadwireguard-openbsd-9a2428ac8f9eeb51f3d6df241a525f2af69d86c0.tar.xz
wireguard-openbsd-9a2428ac8f9eeb51f3d6df241a525f2af69d86c0.zip
pass the table pointer to the lookup()/fecth() methods
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/table_static.c')
-rw-r--r--usr.sbin/smtpd/table_static.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/table_static.c b/usr.sbin/smtpd/table_static.c
index bdd3a59ee42..88377b3f037 100644
--- a/usr.sbin/smtpd/table_static.c
+++ b/usr.sbin/smtpd/table_static.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_static.c,v 1.26 2018/12/27 08:57:03 eric Exp $ */
+/* $OpenBSD: table_static.c,v 1.27 2018/12/27 09:30:29 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -42,9 +42,9 @@
static int table_static_config(struct table *);
static int table_static_update(struct table *);
static int table_static_open(struct table *);
-static int table_static_lookup(void *, enum table_service, const char *,
+static int table_static_lookup(struct table *, enum table_service, const char *,
char **);
-static int table_static_fetch(void *, enum table_service, char **);
+static int table_static_fetch(struct table *, enum table_service, char **);
static void table_static_close(struct table *);
struct table_backend table_backend_static = {
@@ -216,10 +216,9 @@ table_static_close(struct table *table)
}
static int
-table_static_lookup(void *hdl, enum table_service service, const char *key,
+table_static_lookup(struct table *m, enum table_service service, const char *key,
char **dst)
{
- struct table *m = hdl;
char *line;
int ret;
int (*match)(const char *, const char *) = NULL;
@@ -266,9 +265,8 @@ table_static_lookup(void *hdl, enum table_service service, const char *key,
}
static int
-table_static_fetch(void *hdl, enum table_service service, char **dst)
+table_static_fetch(struct table *t, enum table_service service, char **dst)
{
- struct table *t = hdl;
const char *k;
if (!dict_iter(&t->t_dict, &t->t_iter, &k, (void **)NULL)) {