From: op Date: Tue, 14 May 2024 13:28:08 +0000 (+0000) Subject: use C99 syntax for filling the table_backend structs; ok gilles@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b613adb4fae800cd980c9bd94360bd20956a6c25;p=openbsd use C99 syntax for filling the table_backend structs; ok gilles@ --- diff --git a/usr.sbin/smtpd/table_db.c b/usr.sbin/smtpd/table_db.c index b4db8f7ccae..b48f0406551 100644 --- a/usr.sbin/smtpd/table_db.c +++ b/usr.sbin/smtpd/table_db.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_db.c,v 1.25 2021/09/22 17:09:07 eric Exp $ */ +/* $OpenBSD: table_db.c,v 1.26 2024/05/14 13:28:08 op Exp $ */ /* * Copyright (c) 2011 Gilles Chehade @@ -41,18 +41,18 @@ static char *table_db_get_entry_match(void *, const char *, size_t *, int(*)(const char *, const char *)); struct table_backend table_backend_db = { - "db", - K_ALIAS|K_CREDENTIALS|K_DOMAIN|K_NETADDR|K_USERINFO| + .name = "db", + .services = K_ALIAS|K_CREDENTIALS|K_DOMAIN|K_NETADDR|K_USERINFO| K_SOURCE|K_MAILADDR|K_ADDRNAME|K_MAILADDRMAP|K_RELAYHOST| K_STRING|K_REGEX, - table_db_config, - NULL, - NULL, - table_db_open, - table_db_update, - table_db_close, - table_db_lookup, - table_db_fetch, + .config = table_db_config, + .add = NULL, + .dump = NULL, + .open = table_db_open, + .update = table_db_update, + .close = table_db_close, + .lookup = table_db_lookup, + .fetch = table_db_fetch, }; static struct keycmp { diff --git a/usr.sbin/smtpd/table_getpwnam.c b/usr.sbin/smtpd/table_getpwnam.c index d40f1920073..36e6adc710e 100644 --- a/usr.sbin/smtpd/table_getpwnam.c +++ b/usr.sbin/smtpd/table_getpwnam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_getpwnam.c,v 1.14 2021/06/14 17:58:16 eric Exp $ */ +/* $OpenBSD: table_getpwnam.c,v 1.15 2024/05/14 13:28:08 op Exp $ */ /* * Copyright (c) 2012 Gilles Chehade @@ -30,15 +30,16 @@ static int table_getpwnam_lookup(struct table *, enum table_service, const char static void table_getpwnam_close(struct table *); struct table_backend table_backend_getpwnam = { - "getpwnam", - K_USERINFO, - table_getpwnam_config, - NULL, - NULL, - table_getpwnam_open, - table_getpwnam_update, - table_getpwnam_close, - table_getpwnam_lookup, + .name = "getpwnam", + .services = K_USERINFO, + .config = table_getpwnam_config, + .add = NULL, + .dump = NULL, + .open = table_getpwnam_open, + .update = table_getpwnam_update, + .close = table_getpwnam_close, + .lookup = table_getpwnam_lookup, + .fetch = NULL, }; diff --git a/usr.sbin/smtpd/table_proc.c b/usr.sbin/smtpd/table_proc.c index bd40bac6bf5..b823707eb30 100644 --- a/usr.sbin/smtpd/table_proc.c +++ b/usr.sbin/smtpd/table_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_proc.c,v 1.18 2024/05/07 12:10:06 op Exp $ */ +/* $OpenBSD: table_proc.c,v 1.19 2024/05/14 13:28:08 op Exp $ */ /* * Copyright (c) 2024 Omar Polo @@ -280,14 +280,14 @@ table_proc_fetch(struct table *table, enum table_service s, char **dst) } struct table_backend table_backend_proc = { - "proc", - K_ANY, - NULL, - NULL, - NULL, - table_proc_open, - table_proc_update, - table_proc_close, - table_proc_lookup, - table_proc_fetch, + .name = "proc", + .services = K_ANY, + .config = NULL, + .add = NULL, + .dump = NULL, + .open = table_proc_open, + .update = table_proc_update, + .close = table_proc_close, + .lookup = table_proc_lookup, + .fetch = table_proc_fetch, }; diff --git a/usr.sbin/smtpd/table_static.c b/usr.sbin/smtpd/table_static.c index 85f2b7a4f81..9d202bb6c7c 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.34 2024/02/11 09:24:26 op Exp $ */ +/* $OpenBSD: table_static.c,v 1.35 2024/05/14 13:28:08 op Exp $ */ /* * Copyright (c) 2013 Eric Faurot @@ -43,18 +43,18 @@ static int table_static_fetch(struct table *, enum table_service, char **); static void table_static_close(struct table *); struct table_backend table_backend_static = { - "static", - K_ALIAS|K_CREDENTIALS|K_DOMAIN|K_NETADDR|K_USERINFO| + .name = "static", + .services = K_ALIAS|K_CREDENTIALS|K_DOMAIN|K_NETADDR|K_USERINFO| K_SOURCE|K_MAILADDR|K_ADDRNAME|K_MAILADDRMAP|K_RELAYHOST| K_STRING|K_REGEX, - table_static_config, - table_static_add, - table_static_dump, - table_static_open, - table_static_update, - table_static_close, - table_static_lookup, - table_static_fetch + .config = table_static_config, + .add = table_static_add, + .dump = table_static_dump, + .open = table_static_open, + .update = table_static_update, + .close = table_static_close, + .lookup = table_static_lookup, + .fetch = table_static_fetch }; static struct keycmp {