dovecot-2.0: Removed MEMBER() macro. Require C99 style struct in...

dovecot at dovecot.org dovecot at dovecot.org
Fri Dec 4 22:03:41 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/b757dab45756
changeset: 10410:b757dab45756
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Dec 04 13:52:35 2009 -0600
description:
Removed MEMBER() macro. Require C99 style struct initializer.

diffstat:

92 files changed, 832 insertions(+), 930 deletions(-)
src/anvil/anvil-settings.c                        |   38 ++--
src/auth/auth-settings.c                          |  195 ++++++++++-----------
src/auth/auth.c                                   |    4 
src/auth/db-ldap.c                                |   60 +++---
src/auth/db-sql.c                                 |   14 -
src/auth/mech-anonymous.c                         |    4 
src/auth/mech-apop.c                              |    4 
src/auth/mech-cram-md5.c                          |    4 
src/auth/mech-digest-md5.c                        |    4 
src/auth/mech-external.c                          |    4 
src/auth/mech-gssapi.c                            |    8 
src/auth/mech-login.c                             |    4 
src/auth/mech-ntlm.c                              |    4 
src/auth/mech-otp.c                               |    4 
src/auth/mech-plain.c                             |    4 
src/auth/mech-rpa.c                               |    4 
src/auth/mech-skey.c                              |    4 
src/auth/mech-winbind.c                           |    8 
src/auth/passdb-bsdauth.c                         |    2 
src/auth/passdb-checkpassword.c                   |    2 
src/auth/passdb-ldap.c                            |    2 
src/auth/passdb-pam.c                             |    6 
src/auth/passdb-passwd-file.c                     |    2 
src/auth/passdb-passwd.c                          |    2 
src/auth/passdb-shadow.c                          |    2 
src/auth/passdb-sia.c                             |    2 
src/auth/passdb-sql.c                             |    2 
src/auth/passdb-vpopmail.c                        |    6 
src/auth/userdb-checkpassword.c                   |    2 
src/auth/userdb-ldap.c                            |    2 
src/auth/userdb-nss.c                             |    2 
src/auth/userdb-passwd-file.c                     |    2 
src/auth/userdb-passwd.c                          |    2 
src/auth/userdb-prefetch.c                        |    2 
src/auth/userdb-sql.c                             |    2 
src/auth/userdb-static.c                          |    2 
src/auth/userdb-vpopmail.c                        |    2 
src/config/config-settings.c                      |   38 ++--
src/dict/dict-settings.c                          |   56 +++---
src/imap-login/imap-login-settings.c              |   55 ++---
src/imap/imap-settings.c                          |   73 +++----
src/lib-dict/dict-client.c                        |    2 
src/lib-dict/dict-db.c                            |    2 
src/lib-dict/dict-file.c                          |    9 
src/lib-dict/dict-sql.c                           |    2 
src/lib-index/mail-index-strmap.c                 |    7 
src/lib-index/mailbox-list-index.c                |    7 
src/lib-lda/duplicate.c                           |   12 -
src/lib-lda/lda-settings.c                        |   41 ++--
src/lib-master/master-service-settings.c          |   30 +--
src/lib-settings/settings-parser.c                |   16 -
src/lib-sql/driver-mysql.c                        |    6 
src/lib-sql/driver-pgsql.c                        |    4 
src/lib-sql/driver-sqlite.c                       |    6 
src/lib-sql/sql-api.c                             |    2 
src/lib-storage/index/cydir/cydir-storage.c       |   14 -
src/lib-storage/index/dbox-multi/mdbox-settings.c |   26 +-
src/lib-storage/index/dbox-multi/mdbox-storage.c  |   14 -
src/lib-storage/index/dbox-single/sdbox-storage.c |   14 -
src/lib-storage/index/maildir/maildir-settings.c  |   22 +-
src/lib-storage/index/maildir/maildir-storage.c   |   14 -
src/lib-storage/index/mbox/mbox-settings.c        |   30 +--
src/lib-storage/index/mbox/mbox-storage.c         |   14 -
src/lib-storage/index/raw/raw-storage.c           |   14 -
src/lib-storage/index/shared/shared-list.c        |    8 
src/lib-storage/index/shared/shared-storage.c     |    8 
src/lib-storage/list/mailbox-list-fs.c            |    8 
src/lib-storage/list/mailbox-list-maildir.c       |   16 -
src/lib-storage/mail-storage-settings.c           |  164 ++++++++---------
src/lib-storage/test-mail-storage.c               |    6 
src/lib-storage/test-mailbox.c                    |    6 
src/lib/macros.h                                  |    8 
src/lib/mempool-alloconly.c                       |    8 
src/lib/mempool-datastack.c                       |    6 
src/lib/mempool-system-clean.c                    |    6 
src/lib/mempool-system.c                          |    6 
src/lib/mempool-unsafe-datastack.c                |    6 
src/lmtp/lmtp-settings.c                          |   56 ++----
src/log/log-settings.c                            |   36 +--
src/login-common/login-settings.c                 |   69 +++----
src/master/master-settings.c                      |  166 ++++++++---------
src/plugins/acl/acl-backend-vfile.c               |    7 
src/plugins/convert/convert-storage.c             |    7 
src/plugins/fts-lucene/fts-backend-lucene.c       |    4 
src/plugins/fts-solr/fts-backend-solr.c           |    4 
src/plugins/fts-squat/fts-backend-squat.c         |    4 
src/plugins/quota/quota-maildir.c                 |    7 
src/plugins/virtual/virtual-storage.c             |   14 -
src/pop3-login/pop3-login-settings.c              |   51 ++---
src/pop3/pop3-settings.c                          |   73 +++----
src/ssl-params/ssl-params-settings.c              |   52 ++---
src/util/maildirlock.c                            |    9 

diffs (truncated from 3034 to 300 lines):

diff -r 48b8752c793d -r b757dab45756 src/anvil/anvil-settings.c
--- a/src/anvil/anvil-settings.c	Thu Dec 03 11:14:45 2009 -0600
+++ b/src/anvil/anvil-settings.c	Fri Dec 04 13:52:35 2009 -0600
@@ -22,26 +22,26 @@ static buffer_t anvil_unix_listeners_buf
 /* </settings checks> */
 
 struct service_settings anvil_service_settings = {
-	MEMBER(name) "anvil",
-	MEMBER(protocol) "",
-	MEMBER(type) "anvil",
-	MEMBER(executable) "anvil",
-	MEMBER(user) "dovecot",
-	MEMBER(group) "",
-	MEMBER(privileged_group) "",
-	MEMBER(extra_groups) "",
-	MEMBER(chroot) "empty",
+	.name = "anvil",
+	.protocol = "",
+	.type = "anvil",
+	.executable = "anvil",
+	.user = "dovecot",
+	.group = "",
+	.privileged_group = "",
+	.extra_groups = "",
+	.chroot = "empty",
 
-	MEMBER(drop_priv_before_exec) FALSE,
+	.drop_priv_before_exec = FALSE,
 
-	MEMBER(process_min_avail) 1,
-	MEMBER(process_limit) 1,
-	MEMBER(client_limit) 0,
-	MEMBER(service_count) 0,
-	MEMBER(vsz_limit) -1U,
+	.process_min_avail = 1,
+	.process_limit = 1,
+	.client_limit = 0,
+	.service_count = 0,
+	.vsz_limit = -1U,
 
-	MEMBER(unix_listeners) { { &anvil_unix_listeners_buf,
-				   sizeof(anvil_unix_listeners[0]) } },
-	MEMBER(fifo_listeners) ARRAY_INIT,
-	MEMBER(inet_listeners) ARRAY_INIT
+	.unix_listeners = { { &anvil_unix_listeners_buf,
+			      sizeof(anvil_unix_listeners[0]) } },
+	.fifo_listeners = ARRAY_INIT,
+	.inet_listeners = ARRAY_INIT
 };
diff -r 48b8752c793d -r b757dab45756 src/auth/auth-settings.c
--- a/src/auth/auth-settings.c	Thu Dec 03 11:14:45 2009 -0600
+++ b/src/auth/auth-settings.c	Fri Dec 04 13:52:35 2009 -0600
@@ -31,28 +31,28 @@ static buffer_t auth_unix_listeners_buf 
 /* </settings checks> */
 
 struct service_settings auth_service_settings = {
-	MEMBER(name) "auth",
-	MEMBER(protocol) "",
-	MEMBER(type) "",
-	MEMBER(executable) "auth",
-	MEMBER(user) "",
-	MEMBER(group) "",
-	MEMBER(privileged_group) "",
-	MEMBER(extra_groups) "",
-	MEMBER(chroot) "",
-
-	MEMBER(drop_priv_before_exec) FALSE,
-
-	MEMBER(process_min_avail) 0,
-	MEMBER(process_limit) 1,
-	MEMBER(client_limit) 0,
-	MEMBER(service_count) 0,
-	MEMBER(vsz_limit) -1U,
-
-	MEMBER(unix_listeners) { { &auth_unix_listeners_buf,
-				   sizeof(auth_unix_listeners[0]) } },
-	MEMBER(fifo_listeners) ARRAY_INIT,
-	MEMBER(inet_listeners) ARRAY_INIT
+	.name = "auth",
+	.protocol = "",
+	.type = "",
+	.executable = "auth",
+	.user = "",
+	.group = "",
+	.privileged_group = "",
+	.extra_groups = "",
+	.chroot = "",
+
+	.drop_priv_before_exec = FALSE,
+
+	.process_min_avail = 0,
+	.process_limit = 1,
+	.client_limit = 0,
+	.service_count = 0,
+	.vsz_limit = -1U,
+
+	.unix_listeners = { { &auth_unix_listeners_buf,
+			      sizeof(auth_unix_listeners[0]) } },
+	.fifo_listeners = ARRAY_INIT,
+	.inet_listeners = ARRAY_INIT
 };
 
 /* <settings checks> */
@@ -68,28 +68,28 @@ static buffer_t auth_worker_unix_listene
 /* </settings checks> */
 
 struct service_settings auth_worker_service_settings = {
-	MEMBER(name) "auth-worker",
-	MEMBER(protocol) "",
-	MEMBER(type) "",
-	MEMBER(executable) "auth -w",
-	MEMBER(user) "",
-	MEMBER(group) "",
-	MEMBER(privileged_group) "",
-	MEMBER(extra_groups) "",
-	MEMBER(chroot) "",
-
-	MEMBER(drop_priv_before_exec) FALSE,
-
-	MEMBER(process_min_avail) 0,
-	MEMBER(process_limit) 0,
-	MEMBER(client_limit) 1,
-	MEMBER(service_count) 0,
-	MEMBER(vsz_limit) -1U,
-
-	MEMBER(unix_listeners) { { &auth_worker_unix_listeners_buf,
-				   sizeof(auth_worker_unix_listeners[0]) } },
-	MEMBER(fifo_listeners) ARRAY_INIT,
-	MEMBER(inet_listeners) ARRAY_INIT
+	.name = "auth-worker",
+	.protocol = "",
+	.type = "",
+	.executable = "auth -w",
+	.user = "",
+	.group = "",
+	.privileged_group = "",
+	.extra_groups = "",
+	.chroot = "",
+
+	.drop_priv_before_exec = FALSE,
+
+	.process_min_avail = 0,
+	.process_limit = 0,
+	.client_limit = 1,
+	.service_count = 0,
+	.vsz_limit = -1U,
+
+	.unix_listeners = { { &auth_worker_unix_listeners_buf,
+			      sizeof(auth_worker_unix_listeners[0]) } },
+	.fifo_listeners = ARRAY_INIT,
+	.inet_listeners = ARRAY_INIT
 };
 
 #undef DEF
@@ -105,15 +105,13 @@ static const struct setting_define auth_
 };
 
 const struct setting_parser_info auth_passdb_setting_parser_info = {
-	MEMBER(module_name) NULL,
-	MEMBER(defines) auth_passdb_setting_defines,
-	MEMBER(defaults) NULL,
-
-	MEMBER(type_offset) offsetof(struct auth_passdb_settings, driver),
-	MEMBER(struct_size) sizeof(struct auth_passdb_settings),
-
-	MEMBER(parent_offset) (size_t)-1,
-	MEMBER(parent) &auth_setting_parser_info
+	.defines = auth_passdb_setting_defines,
+
+	.type_offset = offsetof(struct auth_passdb_settings, driver),
+	.struct_size = sizeof(struct auth_passdb_settings),
+
+	.parent_offset = (size_t)-1,
+	.parent = &auth_setting_parser_info
 };
 
 #undef DEF
@@ -128,15 +126,13 @@ static const struct setting_define auth_
 };
 
 const struct setting_parser_info auth_userdb_setting_parser_info = {
-	MEMBER(module_name) NULL,
-	MEMBER(defines) auth_userdb_setting_defines,
-	MEMBER(defaults) NULL,
-
-	MEMBER(type_offset) offsetof(struct auth_userdb_settings, driver),
-	MEMBER(struct_size) sizeof(struct auth_userdb_settings),
-
-	MEMBER(parent_offset) (size_t)-1,
-	MEMBER(parent) &auth_setting_parser_info
+	.defines = auth_userdb_setting_defines,
+
+	.type_offset = offsetof(struct auth_userdb_settings, driver),
+	.struct_size = sizeof(struct auth_userdb_settings),
+
+	.parent_offset = (size_t)-1,
+	.parent = &auth_setting_parser_info
 };
 
 /* we're kind of kludging here to avoid "auth_" prefix in the struct fields */
@@ -180,47 +176,46 @@ static const struct setting_define auth_
 };
 
 static const struct auth_settings auth_default_settings = {
-	MEMBER(mechanisms) "plain",
-	MEMBER(realms) "",
-	MEMBER(default_realm) "",
-	MEMBER(cache_size) 0,
-	MEMBER(cache_ttl) 60*60,
-	MEMBER(cache_negative_ttl) 0,
-	MEMBER(username_chars) "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@",
-	MEMBER(username_translation) "",
-	MEMBER(username_format) "",
-	MEMBER(master_user_separator) "",
-	MEMBER(anonymous_username) "anonymous",
-	MEMBER(krb5_keytab) "",
-	MEMBER(gssapi_hostname) "",
-	MEMBER(winbind_helper_path) "/usr/bin/ntlm_auth",
-	MEMBER(failure_delay) 2,
-
-	MEMBER(verbose) FALSE,
-	MEMBER(debug) FALSE,
-	MEMBER(debug_passwords) FALSE,
-	MEMBER(ssl_require_client_cert) FALSE,
-	MEMBER(ssl_username_from_cert) FALSE,
-	MEMBER(use_winbind) FALSE,
-
-	MEMBER(worker_max_count) 30,
-
-	MEMBER(passdbs) ARRAY_INIT,
-	MEMBER(userdbs) ARRAY_INIT
+	.mechanisms = "plain",
+	.realms = "",
+	.default_realm = "",
+	.cache_size = 0,
+	.cache_ttl = 60*60,
+	.cache_negative_ttl = 0,
+	.username_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@",
+	.username_translation = "",
+	.username_format = "",
+	.master_user_separator = "",
+	.anonymous_username = "anonymous",
+	.krb5_keytab = "",
+	.gssapi_hostname = "",
+	.winbind_helper_path = "/usr/bin/ntlm_auth",
+	.failure_delay = 2,
+
+	.verbose = FALSE,
+	.debug = FALSE,
+	.debug_passwords = FALSE,
+	.ssl_require_client_cert = FALSE,
+	.ssl_username_from_cert = FALSE,
+	.use_winbind = FALSE,
+
+	.worker_max_count = 30,
+
+	.passdbs = ARRAY_INIT,
+	.userdbs = ARRAY_INIT
 };
 
 const struct setting_parser_info auth_setting_parser_info = {
-	MEMBER(module_name) "auth",
-	MEMBER(defines) auth_setting_defines,
-	MEMBER(defaults) &auth_default_settings,
-
-	MEMBER(type_offset) (size_t)-1,
-	MEMBER(struct_size) sizeof(struct auth_settings),
-
-	MEMBER(parent_offset) (size_t)-1,
-	MEMBER(parent) NULL,
-
-	MEMBER(check_func) auth_settings_check
+	.module_name = "auth",
+	.defines = auth_setting_defines,
+	.defaults = &auth_default_settings,
+
+	.type_offset = (size_t)-1,
+	.struct_size = sizeof(struct auth_settings),
+
+	.parent_offset = (size_t)-1,
+
+	.check_func = auth_settings_check
 };
 
 /* <settings checks> */
diff -r 48b8752c793d -r b757dab45756 src/auth/auth.c
--- a/src/auth/auth.c	Thu Dec 03 11:14:45 2009 -0600
+++ b/src/auth/auth.c	Fri Dec 04 13:52:35 2009 -0600
@@ -19,8 +19,8 @@
 #define AUTH_PENALTY_ANVIL_PATH "anvil-auth-penalty"
 
 struct auth_userdb_settings userdb_dummy_set = {
-	MEMBER(driver) "static",
-	MEMBER(args) ""
+	.driver = "static",
+	.args = ""
 };
 
 struct auth *auth_preinit(struct auth_settings *set)
diff -r 48b8752c793d -r b757dab45756 src/auth/db-ldap.c


More information about the dovecot-cvs mailing list