use C99 syntax for filling the table_backend structs; ok gilles@
authorop <op@openbsd.org>
Tue, 14 May 2024 13:28:08 +0000 (13:28 +0000)
committerop <op@openbsd.org>
Tue, 14 May 2024 13:28:08 +0000 (13:28 +0000)
usr.sbin/smtpd/table_db.c
usr.sbin/smtpd/table_getpwnam.c
usr.sbin/smtpd/table_proc.c
usr.sbin/smtpd/table_static.c

index b4db8f7..b48f040 100644 (file)
@@ -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 <gilles@poolp.org>
@@ -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 {
index d40f192..36e6adc 100644 (file)
@@ -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 <gilles@poolp.org>
@@ -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,
 };
 
 
index bd40bac..b823707 100644 (file)
@@ -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 <op@openbsd.org>
@@ -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,
 };
index 85f2b7a..9d202bb 100644 (file)
@@ -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 <eric@openbsd.org>
@@ -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 {