From: Timo Sirainen Date: Fri, 4 Dec 2009 19:52:35 +0000 (-0600) Subject: Removed MEMBER() macro. Require C99 style struct initializer. X-Git-Tag: 2.0.beta1~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7bafda1813454621e03615e83d55bccfa7cc56bd;p=thirdparty%2Fdovecot%2Fcore.git Removed MEMBER() macro. Require C99 style struct initializer. --HG-- branch : HEAD --- diff --git a/src/anvil/anvil-settings.c b/src/anvil/anvil-settings.c index e268a907ca..cbc38f7d22 100644 --- a/src/anvil/anvil-settings.c +++ b/src/anvil/anvil-settings.c @@ -22,26 +22,26 @@ static buffer_t anvil_unix_listeners_buf = { /* */ 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 --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index 76497871b7..fb0b1a9c8b 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -31,28 +31,28 @@ static buffer_t auth_unix_listeners_buf = { /* */ 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 }; /* */ @@ -68,28 +68,28 @@ static buffer_t auth_worker_unix_listeners_buf = { /* */ 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_passdb_setting_defines[] = { }; const struct setting_parser_info auth_passdb_setting_parser_info = { - MEMBER(module_name) NULL, - MEMBER(defines) auth_passdb_setting_defines, - MEMBER(defaults) NULL, + .defines = auth_passdb_setting_defines, - MEMBER(type_offset) offsetof(struct auth_passdb_settings, driver), - MEMBER(struct_size) sizeof(struct auth_passdb_settings), + .type_offset = offsetof(struct auth_passdb_settings, driver), + .struct_size = sizeof(struct auth_passdb_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &auth_setting_parser_info + .parent_offset = (size_t)-1, + .parent = &auth_setting_parser_info }; #undef DEF @@ -128,15 +126,13 @@ static const struct setting_define auth_userdb_setting_defines[] = { }; const struct setting_parser_info auth_userdb_setting_parser_info = { - MEMBER(module_name) NULL, - MEMBER(defines) auth_userdb_setting_defines, - MEMBER(defaults) NULL, + .defines = auth_userdb_setting_defines, - MEMBER(type_offset) offsetof(struct auth_userdb_settings, driver), - MEMBER(struct_size) sizeof(struct auth_userdb_settings), + .type_offset = offsetof(struct auth_userdb_settings, driver), + .struct_size = sizeof(struct auth_userdb_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &auth_setting_parser_info + .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_setting_defines[] = { }; 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, + .module_name = "auth", + .defines = auth_setting_defines, + .defaults = &auth_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct auth_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct auth_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) auth_settings_check + .check_func = auth_settings_check }; /* */ diff --git a/src/auth/auth.c b/src/auth/auth.c index ec360adbac..e3c9575f63 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -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 --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 9f08cda186..a871354168 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -113,36 +113,36 @@ static struct setting_def setting_defs[] = { }; static struct ldap_settings default_ldap_settings = { - MEMBER(hosts) NULL, - MEMBER(uris) NULL, - MEMBER(dn) NULL, - MEMBER(dnpass) NULL, - MEMBER(auth_bind) FALSE, - MEMBER(auth_bind_userdn) NULL, - MEMBER(tls) FALSE, - MEMBER(sasl_bind) FALSE, - MEMBER(sasl_mech) NULL, - MEMBER(sasl_realm) NULL, - MEMBER(sasl_authz_id) NULL, - MEMBER(tls_ca_cert_file) NULL, - MEMBER(tls_ca_cert_dir) NULL, - MEMBER(tls_cert_file) NULL, - MEMBER(tls_key_file) NULL, - MEMBER(tls_cipher_suite) NULL, - MEMBER(tls_require_cert) NULL, - MEMBER(deref) "never", - MEMBER(scope) "subtree", - MEMBER(base) NULL, - MEMBER(ldap_version) 3, - MEMBER(debug_level) "0", - MEMBER(ldaprc_path) "", - MEMBER(user_attrs) "homeDirectory=home,uidNumber=uid,gidNumber=gid", - MEMBER(user_filter) "(&(objectClass=posixAccount)(uid=%u))", - MEMBER(pass_attrs) "uid=user,userPassword=password", - MEMBER(pass_filter) "(&(objectClass=posixAccount)(uid=%u))", - MEMBER(iterate_attrs) "uid=user", - MEMBER(iterate_filter) "(objectClass=posixAccount)", - MEMBER(default_pass_scheme) "crypt" + .hosts = NULL, + .uris = NULL, + .dn = NULL, + .dnpass = NULL, + .auth_bind = FALSE, + .auth_bind_userdn = NULL, + .tls = FALSE, + .sasl_bind = FALSE, + .sasl_mech = NULL, + .sasl_realm = NULL, + .sasl_authz_id = NULL, + .tls_ca_cert_file = NULL, + .tls_ca_cert_dir = NULL, + .tls_cert_file = NULL, + .tls_key_file = NULL, + .tls_cipher_suite = NULL, + .tls_require_cert = NULL, + .deref = "never", + .scope = "subtree", + .base = NULL, + .ldap_version = 3, + .debug_level = "0", + .ldaprc_path = "", + .user_attrs = "homeDirectory=home,uidNumber=uid,gidNumber=gid", + .user_filter = "(&(objectClass=posixAccount)(uid=%u))", + .pass_attrs = "uid=user,userPassword=password", + .pass_filter = "(&(objectClass=posixAccount)(uid=%u))", + .iterate_attrs = "uid=user", + .iterate_filter = "(objectClass=posixAccount)", + .default_pass_scheme = "crypt" }; static struct ldap_connection *ldap_connections = NULL; diff --git a/src/auth/db-sql.c b/src/auth/db-sql.c index 1a651f5e3b..2506943a8e 100644 --- a/src/auth/db-sql.c +++ b/src/auth/db-sql.c @@ -28,13 +28,13 @@ static struct setting_def setting_defs[] = { }; static struct sql_settings default_sql_settings = { - MEMBER(driver) NULL, - MEMBER(connect) NULL, - MEMBER(password_query) "SELECT username, domain, password FROM users WHERE username = '%n' AND domain = '%d'", - MEMBER(user_query) "SELECT home, uid, gid FROM users WHERE username = '%n' AND domain = '%d'", - MEMBER(update_query) "UPDATE users SET password = '%w' WHERE username = '%n' AND domain = '%d'", - MEMBER(iterate_query) "SELECT username, domain FROM users", - MEMBER(default_pass_scheme) "MD5" + .driver = NULL, + .connect = NULL, + .password_query = "SELECT username, domain, password FROM users WHERE username = '%n' AND domain = '%d'", + .user_query = "SELECT home, uid, gid FROM users WHERE username = '%n' AND domain = '%d'", + .update_query = "UPDATE users SET password = '%w' WHERE username = '%n' AND domain = '%d'", + .iterate_query = "SELECT username, domain FROM users", + .default_pass_scheme = "MD5" }; static struct sql_connection *connections = NULL; diff --git a/src/auth/mech-anonymous.c b/src/auth/mech-anonymous.c index ad8c8ec036..0e1605473b 100644 --- a/src/auth/mech-anonymous.c +++ b/src/auth/mech-anonymous.c @@ -37,8 +37,8 @@ static struct auth_request *mech_anonymous_auth_new(void) const struct mech_module mech_anonymous = { "ANONYMOUS", - MEMBER(flags) MECH_SEC_ANONYMOUS, - MEMBER(passdb_need) MECH_PASSDB_NEED_NOTHING, + .flags = MECH_SEC_ANONYMOUS, + .passdb_need = MECH_PASSDB_NEED_NOTHING, mech_anonymous_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-apop.c b/src/auth/mech-apop.c index 8e2b559658..a3c4026bc3 100644 --- a/src/auth/mech-apop.c +++ b/src/auth/mech-apop.c @@ -155,8 +155,8 @@ static struct auth_request *mech_apop_auth_new(void) const struct mech_module mech_apop = { "APOP", - MEMBER(flags) MECH_SEC_PRIVATE | MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, - MEMBER(passdb_need) MECH_PASSDB_NEED_VERIFY_RESPONSE, + .flags = MECH_SEC_PRIVATE | MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, + .passdb_need = MECH_PASSDB_NEED_VERIFY_RESPONSE, mech_apop_auth_new, mech_apop_auth_initial, diff --git a/src/auth/mech-cram-md5.c b/src/auth/mech-cram-md5.c index 6c92c11322..0837fbab73 100644 --- a/src/auth/mech-cram-md5.c +++ b/src/auth/mech-cram-md5.c @@ -181,8 +181,8 @@ static struct auth_request *mech_cram_md5_auth_new(void) const struct mech_module mech_cram_md5 = { "CRAM-MD5", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, - MEMBER(passdb_need) MECH_PASSDB_NEED_VERIFY_RESPONSE, + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, + .passdb_need = MECH_PASSDB_NEED_VERIFY_RESPONSE, mech_cram_md5_auth_new, mech_cram_md5_auth_initial, diff --git a/src/auth/mech-digest-md5.c b/src/auth/mech-digest-md5.c index d6e34fbd0a..16d303bb77 100644 --- a/src/auth/mech-digest-md5.c +++ b/src/auth/mech-digest-md5.c @@ -591,9 +591,9 @@ static struct auth_request *mech_digest_md5_auth_new(void) const struct mech_module mech_digest_md5 = { "DIGEST-MD5", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE | + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE | MECH_SEC_MUTUAL_AUTH, - MEMBER(passdb_need) MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, mech_digest_md5_auth_new, mech_digest_md5_auth_initial, diff --git a/src/auth/mech-external.c b/src/auth/mech-external.c index 92a48344cb..67e4151949 100644 --- a/src/auth/mech-external.c +++ b/src/auth/mech-external.c @@ -42,8 +42,8 @@ static struct auth_request *mech_external_auth_new(void) const struct mech_module mech_external = { "EXTERNAL", - MEMBER(flags) 0, - MEMBER(passdb_need) MECH_PASSDB_NEED_VERIFY_PLAIN, + .flags = 0, + .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN, mech_external_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-gssapi.c b/src/auth/mech-gssapi.c index 80ce19e87c..5486495165 100644 --- a/src/auth/mech-gssapi.c +++ b/src/auth/mech-gssapi.c @@ -633,8 +633,8 @@ mech_gssapi_auth_free(struct auth_request *request) const struct mech_module mech_gssapi = { "GSSAPI", - MEMBER(flags) 0, - MEMBER(passdb_need) MECH_PASSDB_NEED_NOTHING, + .flags = 0, + .passdb_need = MECH_PASSDB_NEED_NOTHING, mech_gssapi_auth_new, mech_gssapi_auth_initial, @@ -648,8 +648,8 @@ const struct mech_module mech_gssapi = { const struct mech_module mech_gssapi_spnego = { "GSS-SPNEGO", - MEMBER(flags) 0, - MEMBER(passdb_need) MECH_PASSDB_NEED_NOTHING, + .flags = 0, + .passdb_need = MECH_PASSDB_NEED_NOTHING, mech_gssapi_auth_new, mech_gssapi_auth_initial, diff --git a/src/auth/mech-login.c b/src/auth/mech-login.c index 4305a6f3fe..225c942bca 100644 --- a/src/auth/mech-login.c +++ b/src/auth/mech-login.c @@ -66,8 +66,8 @@ static struct auth_request *mech_login_auth_new(void) const struct mech_module mech_login = { "LOGIN", - MEMBER(flags) MECH_SEC_PLAINTEXT, - MEMBER(passdb_need) MECH_PASSDB_NEED_VERIFY_PLAIN, + .flags = MECH_SEC_PLAINTEXT, + .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN, mech_login_auth_new, mech_login_auth_initial, diff --git a/src/auth/mech-ntlm.c b/src/auth/mech-ntlm.c index 02199e8359..87e8fac155 100644 --- a/src/auth/mech-ntlm.c +++ b/src/auth/mech-ntlm.c @@ -250,8 +250,8 @@ static struct auth_request *mech_ntlm_auth_new(void) const struct mech_module mech_ntlm = { "NTLM", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, - MEMBER(passdb_need) MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, + .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, mech_ntlm_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-otp.c b/src/auth/mech-otp.c index 8ef5decec1..b204de88aa 100644 --- a/src/auth/mech-otp.c +++ b/src/auth/mech-otp.c @@ -252,8 +252,8 @@ static struct auth_request *mech_otp_auth_new(void) const struct mech_module mech_otp = { "OTP", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, - MEMBER(passdb_need) MECH_PASSDB_NEED_SET_CREDENTIALS, + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, + .passdb_need = MECH_PASSDB_NEED_SET_CREDENTIALS, mech_otp_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-plain.c b/src/auth/mech-plain.c index 82cfe89116..65b6890ad5 100644 --- a/src/auth/mech-plain.c +++ b/src/auth/mech-plain.c @@ -78,8 +78,8 @@ static struct auth_request *mech_plain_auth_new(void) const struct mech_module mech_plain = { "PLAIN", - MEMBER(flags) MECH_SEC_PLAINTEXT, - MEMBER(passdb_need) MECH_PASSDB_NEED_VERIFY_PLAIN, + .flags = MECH_SEC_PLAINTEXT, + .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN, mech_plain_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-rpa.c b/src/auth/mech-rpa.c index 45ee8db3c8..0c0c194b50 100644 --- a/src/auth/mech-rpa.c +++ b/src/auth/mech-rpa.c @@ -581,9 +581,9 @@ static struct auth_request *mech_rpa_auth_new(void) const struct mech_module mech_rpa = { "RPA", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE | + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE | MECH_SEC_MUTUAL_AUTH, - MEMBER(passdb_need) MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, mech_rpa_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-skey.c b/src/auth/mech-skey.c index f2bca22411..d6632e40bf 100644 --- a/src/auth/mech-skey.c +++ b/src/auth/mech-skey.c @@ -189,8 +189,8 @@ static struct auth_request *mech_skey_auth_new(void) const struct mech_module mech_skey = { "SKEY", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, - MEMBER(passdb_need) MECH_PASSDB_NEED_SET_CREDENTIALS, + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, + .passdb_need = MECH_PASSDB_NEED_SET_CREDENTIALS, mech_skey_auth_new, mech_generic_auth_initial, diff --git a/src/auth/mech-winbind.c b/src/auth/mech-winbind.c index beb036976b..daef851a15 100644 --- a/src/auth/mech-winbind.c +++ b/src/auth/mech-winbind.c @@ -330,8 +330,8 @@ static struct auth_request *mech_winbind_spnego_auth_new(void) const struct mech_module mech_winbind_ntlm = { "NTLM", - MEMBER(flags) MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, - MEMBER(passdb_need) MECH_PASSDB_NEED_NOTHING, + .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE, + .passdb_need = MECH_PASSDB_NEED_NOTHING, mech_winbind_ntlm_auth_new, mech_generic_auth_initial, @@ -342,8 +342,8 @@ const struct mech_module mech_winbind_ntlm = { const struct mech_module mech_winbind_spnego = { "GSS-SPNEGO", - MEMBER(flags) 0, - MEMBER(passdb_need) MECH_PASSDB_NEED_NOTHING, + .flags = 0, + .passdb_need = MECH_PASSDB_NEED_NOTHING, mech_winbind_spnego_auth_new, mech_winbind_auth_initial, diff --git a/src/auth/passdb-bsdauth.c b/src/auth/passdb-bsdauth.c index ea03c1b05a..ddd2fa3314 100644 --- a/src/auth/passdb-bsdauth.c +++ b/src/auth/passdb-bsdauth.c @@ -83,6 +83,6 @@ struct passdb_module_interface passdb_bsdauth = { }; #else struct passdb_module_interface passdb_bsdauth = { - MEMBER(name) "bsdauth" + .name = "bsdauth" }; #endif diff --git a/src/auth/passdb-checkpassword.c b/src/auth/passdb-checkpassword.c index 2dfa9642dd..cfc5192028 100644 --- a/src/auth/passdb-checkpassword.c +++ b/src/auth/passdb-checkpassword.c @@ -283,6 +283,6 @@ struct passdb_module_interface passdb_checkpassword = { }; #else struct passdb_module_interface passdb_checkpassword = { - MEMBER(name) "checkpassword" + .name = "checkpassword" }; #endif diff --git a/src/auth/passdb-ldap.c b/src/auth/passdb-ldap.c index b73d81059a..e5c31ecb25 100644 --- a/src/auth/passdb-ldap.c +++ b/src/auth/passdb-ldap.c @@ -454,6 +454,6 @@ struct passdb_module_interface passdb_ldap_plugin = }; #else struct passdb_module_interface passdb_ldap = { - MEMBER(name) "ldap" + .name = "ldap" }; #endif diff --git a/src/auth/passdb-pam.c b/src/auth/passdb-pam.c index d1b050c48d..17977a67b9 100644 --- a/src/auth/passdb-pam.c +++ b/src/auth/passdb-pam.c @@ -385,6 +385,6 @@ struct passdb_module_interface passdb_pam = { }; #else struct passdb_module_interface passdb_pam = { - MEMBER(name) "pam" + .name = "pam" }; #endif diff --git a/src/auth/passdb-passwd-file.c b/src/auth/passdb-passwd-file.c index 0b5bdad3b5..413f0344e8 100644 --- a/src/auth/passdb-passwd-file.c +++ b/src/auth/passdb-passwd-file.c @@ -191,6 +191,6 @@ struct passdb_module_interface passdb_passwd_file = { }; #else struct passdb_module_interface passdb_passwd_file = { - MEMBER(name) "passwd-file" + .name = "passwd-file" }; #endif diff --git a/src/auth/passdb-passwd.c b/src/auth/passdb-passwd.c index 3e37bf42b9..8a8195404a 100644 --- a/src/auth/passdb-passwd.c +++ b/src/auth/passdb-passwd.c @@ -87,6 +87,6 @@ struct passdb_module_interface passdb_passwd = { #else struct passdb_module_interface passdb_passwd = { - MEMBER(name) "passwd" + .name = "passwd" }; #endif diff --git a/src/auth/passdb-shadow.c b/src/auth/passdb-shadow.c index d29acb7a54..1591020d9e 100644 --- a/src/auth/passdb-shadow.c +++ b/src/auth/passdb-shadow.c @@ -86,6 +86,6 @@ struct passdb_module_interface passdb_shadow = { }; #else struct passdb_module_interface passdb_shadow = { - MEMBER(name) "shadow" + .name = "shadow" }; #endif diff --git a/src/auth/passdb-sia.c b/src/auth/passdb-sia.c index 5d43420f3e..9aeb68a58e 100644 --- a/src/auth/passdb-sia.c +++ b/src/auth/passdb-sia.c @@ -61,6 +61,6 @@ struct passdb_module_interface passdb_sia = { }; #else struct passdb_module_interface passdb_sia = { - MEMBER(name) "sia" + .name = "sia" }; #endif diff --git a/src/auth/passdb-sql.c b/src/auth/passdb-sql.c index d0badbecc9..71e96d7ab4 100644 --- a/src/auth/passdb-sql.c +++ b/src/auth/passdb-sql.c @@ -275,6 +275,6 @@ struct passdb_module_interface passdb_sql = { }; #else struct passdb_module_interface passdb_sql = { - MEMBER(name) "sql" + .name = "sql" }; #endif diff --git a/src/auth/passdb-vpopmail.c b/src/auth/passdb-vpopmail.c index 9e234bec0e..bb5aefc61e 100644 --- a/src/auth/passdb-vpopmail.c +++ b/src/auth/passdb-vpopmail.c @@ -202,6 +202,6 @@ struct passdb_module_interface passdb_vpopmail = { }; #else struct passdb_module_interface passdb_vpopmail = { - MEMBER(name) "vpopmail" + .name = "vpopmail" }; #endif diff --git a/src/auth/userdb-checkpassword.c b/src/auth/userdb-checkpassword.c index 15fff43b0d..64cdd7b25e 100644 --- a/src/auth/userdb-checkpassword.c +++ b/src/auth/userdb-checkpassword.c @@ -268,6 +268,6 @@ struct userdb_module_interface userdb_checkpassword = { }; #else struct userdb_module_interface userdb_checkpassword = { - MEMBER(name) "checkpassword" + .name = "checkpassword" }; #endif diff --git a/src/auth/userdb-ldap.c b/src/auth/userdb-ldap.c index d04dcb71e2..5721b7fde9 100644 --- a/src/auth/userdb-ldap.c +++ b/src/auth/userdb-ldap.c @@ -297,6 +297,6 @@ struct userdb_module_interface userdb_ldap_plugin = }; #else struct userdb_module_interface userdb_ldap = { - MEMBER(name) "ldap" + .name = "ldap" }; #endif diff --git a/src/auth/userdb-nss.c b/src/auth/userdb-nss.c index 6e06f45c15..ae0ff9f7b9 100644 --- a/src/auth/userdb-nss.c +++ b/src/auth/userdb-nss.c @@ -155,6 +155,6 @@ struct userdb_module_interface userdb_nss = { }; #else struct userdb_module_interface userdb_nss = { - MEMBER(name) "nss" + .name = "nss" }; #endif diff --git a/src/auth/userdb-passwd-file.c b/src/auth/userdb-passwd-file.c index 5bae1f0f59..535f354ba4 100644 --- a/src/auth/userdb-passwd-file.c +++ b/src/auth/userdb-passwd-file.c @@ -224,6 +224,6 @@ struct userdb_module_interface userdb_passwd_file = { }; #else struct userdb_module_interface userdb_passwd_file = { - MEMBER(name) "passwd-file" + .name = "passwd-file" }; #endif diff --git a/src/auth/userdb-passwd.c b/src/auth/userdb-passwd.c index c2251374c2..addfef608e 100644 --- a/src/auth/userdb-passwd.c +++ b/src/auth/userdb-passwd.c @@ -168,6 +168,6 @@ struct userdb_module_interface userdb_passwd = { }; #else struct userdb_module_interface userdb_passwd = { - MEMBER(name) "passwd" + .name = "passwd" }; #endif diff --git a/src/auth/userdb-prefetch.c b/src/auth/userdb-prefetch.c index 4d70bea988..5607a65526 100644 --- a/src/auth/userdb-prefetch.c +++ b/src/auth/userdb-prefetch.c @@ -55,6 +55,6 @@ struct userdb_module_interface userdb_prefetch = { }; #else struct userdb_module_interface userdb_prefetch = { - MEMBER(name) "prefetch" + .name = "prefetch" }; #endif diff --git a/src/auth/userdb-sql.c b/src/auth/userdb-sql.c index 96a2b6d964..6006e0a1b2 100644 --- a/src/auth/userdb-sql.c +++ b/src/auth/userdb-sql.c @@ -276,6 +276,6 @@ struct userdb_module_interface userdb_sql = { }; #else struct userdb_module_interface userdb_sql = { - MEMBER(name) "sql" + .name = "sql" }; #endif diff --git a/src/auth/userdb-static.c b/src/auth/userdb-static.c index 7baa104e49..302aef7376 100644 --- a/src/auth/userdb-static.c +++ b/src/auth/userdb-static.c @@ -244,6 +244,6 @@ struct userdb_module_interface userdb_static = { }; #else struct userdb_module_interface userdb_static = { - MEMBER(name) "static" + .name = "static" }; #endif diff --git a/src/auth/userdb-vpopmail.c b/src/auth/userdb-vpopmail.c index 1d79bd1d3d..60469caab2 100644 --- a/src/auth/userdb-vpopmail.c +++ b/src/auth/userdb-vpopmail.c @@ -178,6 +178,6 @@ struct userdb_module_interface userdb_vpopmail = { }; #else struct userdb_module_interface userdb_vpopmail = { - MEMBER(name) "vpopmail" + .name = "vpopmail" }; #endif diff --git a/src/config/config-settings.c b/src/config/config-settings.c index 342a435baf..00859fd1e9 100644 --- a/src/config/config-settings.c +++ b/src/config/config-settings.c @@ -20,26 +20,26 @@ static buffer_t config_unix_listeners_buf = { /* */ struct service_settings config_service_settings = { - MEMBER(name) "config", - MEMBER(protocol) "", - MEMBER(type) "config", - MEMBER(executable) "config", - MEMBER(user) "", - MEMBER(group) "", - MEMBER(privileged_group) "", - MEMBER(extra_groups) "", - MEMBER(chroot) "", + .name = "config", + .protocol = "", + .type = "config", + .executable = "config", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", - MEMBER(drop_priv_before_exec) FALSE, + .drop_priv_before_exec = FALSE, - MEMBER(process_min_avail) 0, - MEMBER(process_limit) 0, - MEMBER(client_limit) 0, - MEMBER(service_count) 0, - MEMBER(vsz_limit) -1U, + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 0, + .vsz_limit = -1U, - MEMBER(unix_listeners) { { &config_unix_listeners_buf, - sizeof(config_unix_listeners[0]) } }, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .unix_listeners = { { &config_unix_listeners_buf, + sizeof(config_unix_listeners[0]) } }, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; diff --git a/src/dict/dict-settings.c b/src/dict/dict-settings.c index bcf816a1d3..55efb171c8 100644 --- a/src/dict/dict-settings.c +++ b/src/dict/dict-settings.c @@ -19,28 +19,28 @@ static buffer_t dict_unix_listeners_buf = { /* */ struct service_settings dict_service_settings = { - MEMBER(name) "dict", - MEMBER(protocol) "", - MEMBER(type) "", - MEMBER(executable) "dict", - MEMBER(user) "dovecot", - MEMBER(group) "", - MEMBER(privileged_group) "", - MEMBER(extra_groups) "", - MEMBER(chroot) "", + .name = "dict", + .protocol = "", + .type = "", + .executable = "dict", + .user = "dovecot", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", - MEMBER(drop_priv_before_exec) FALSE, + .drop_priv_before_exec = FALSE, - MEMBER(process_min_avail) 0, - MEMBER(process_limit) 0, - MEMBER(client_limit) 0, - MEMBER(service_count) 0, - MEMBER(vsz_limit) -1U, + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 0, + .vsz_limit = -1U, - MEMBER(unix_listeners) { { &dict_unix_listeners_buf, - sizeof(dict_unix_listeners[0]) } }, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .unix_listeners = { { &dict_unix_listeners_buf, + sizeof(dict_unix_listeners[0]) } }, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; #undef DEF @@ -56,20 +56,20 @@ static const struct setting_define dict_setting_defines[] = { }; const struct dict_settings dict_default_settings = { - MEMBER(base_dir) PKG_RUNDIR, - MEMBER(dict_db_config) "", - MEMBER(dicts) ARRAY_INIT + .base_dir = PKG_RUNDIR, + .dict_db_config = "", + .dicts = ARRAY_INIT }; const struct setting_parser_info dict_setting_parser_info = { - MEMBER(module_name) "dict", - MEMBER(defines) dict_setting_defines, - MEMBER(defaults) &dict_default_settings, + .module_name = "dict", + .defines = dict_setting_defines, + .defaults = &dict_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct dict_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct dict_settings), - MEMBER(parent_offset) (size_t)-1 + .parent_offset = (size_t)-1 }; const struct dict_settings *dict_settings; diff --git a/src/imap-login/imap-login-settings.c b/src/imap-login/imap-login-settings.c index b005fb8ff2..e390493a43 100644 --- a/src/imap-login/imap-login-settings.c +++ b/src/imap-login/imap-login-settings.c @@ -9,27 +9,27 @@ #include struct service_settings imap_login_service_settings = { - MEMBER(name) "imap-login", - MEMBER(protocol) "imap", - MEMBER(type) "login", - MEMBER(executable) "imap-login", - MEMBER(user) "dovecot", - MEMBER(group) "", - MEMBER(privileged_group) "", - MEMBER(extra_groups) "", - MEMBER(chroot) "login", - - MEMBER(drop_priv_before_exec) FALSE, - - MEMBER(process_min_avail) 0, - MEMBER(process_limit) 0, - MEMBER(client_limit) 0, - MEMBER(service_count) 1, - MEMBER(vsz_limit) 64, - - MEMBER(unix_listeners) ARRAY_INIT, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "imap-login", + .protocol = "imap", + .type = "login", + .executable = "imap-login", + .user = "dovecot", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "login", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 1, + .vsz_limit = 64, + + .unix_listeners = ARRAY_INIT, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; #undef DEF @@ -43,7 +43,7 @@ static const struct setting_define imap_login_setting_defines[] = { }; static const struct imap_login_settings imap_login_default_settings = { - MEMBER(imap_capability) "" + .imap_capability = "" }; static const struct setting_parser_info *imap_login_setting_dependencies[] = { @@ -52,18 +52,15 @@ static const struct setting_parser_info *imap_login_setting_dependencies[] = { }; static const struct setting_parser_info imap_login_setting_parser_info = { - MEMBER(module_name) "imap-login", - MEMBER(defines) imap_login_setting_defines, - MEMBER(defaults) &imap_login_default_settings, - - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct imap_login_settings), + .module_name = "imap-login", + .defines = imap_login_setting_defines, + .defaults = &imap_login_default_settings, - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .type_offset = (size_t)-1, + .struct_size = sizeof(struct imap_login_settings), - MEMBER(check_func) NULL, - MEMBER(dependencies) imap_login_setting_dependencies + .parent_offset = (size_t)-1, + .dependencies = imap_login_setting_dependencies }; const struct setting_parser_info *imap_login_setting_roots[] = { diff --git a/src/imap/imap-settings.c b/src/imap/imap-settings.c index de468b575e..e68059fc81 100644 --- a/src/imap/imap-settings.c +++ b/src/imap/imap-settings.c @@ -27,28 +27,28 @@ static buffer_t imap_unix_listeners_buf = { /* */ struct service_settings imap_service_settings = { - MEMBER(name) "imap", - MEMBER(protocol) "imap", - MEMBER(type) "", - MEMBER(executable) "imap", - 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) 0, - MEMBER(service_count) 1, - MEMBER(vsz_limit) -1U, - - MEMBER(unix_listeners) { { &imap_unix_listeners_buf, - sizeof(imap_unix_listeners[0]) } }, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "imap", + .protocol = "imap", + .type = "", + .executable = "imap", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 1, + .vsz_limit = -1U, + + .unix_listeners = { { &imap_unix_listeners_buf, + sizeof(imap_unix_listeners[0]) } }, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; #undef DEF @@ -74,19 +74,19 @@ static const struct setting_define imap_setting_defines[] = { }; static const struct imap_settings imap_default_settings = { - MEMBER(mail_debug) FALSE, - MEMBER(verbose_proctitle) FALSE, + .mail_debug = FALSE, + .verbose_proctitle = FALSE, /* RFC-2683 recommends at least 8000 bytes. Some clients however don't break large message sets to multiple commands, so we're pretty liberal by default. */ - MEMBER(imap_max_line_length) 64*1024, - MEMBER(imap_idle_notify_interval) 2*60, - MEMBER(imap_capability) "", - MEMBER(imap_client_workarounds) "outlook-idle", - MEMBER(imap_logout_format) "bytes=%i/%o", - MEMBER(imap_id_send) "", - MEMBER(imap_id_log) "" + .imap_max_line_length = 64*1024, + .imap_idle_notify_interval = 2*60, + .imap_capability = "", + .imap_client_workarounds = "outlook-idle", + .imap_logout_format = "bytes=%i/%o", + .imap_id_send = "", + .imap_id_log = "" }; static const struct setting_parser_info *imap_setting_dependencies[] = { @@ -95,18 +95,17 @@ static const struct setting_parser_info *imap_setting_dependencies[] = { }; const struct setting_parser_info imap_setting_parser_info = { - MEMBER(module_name) "imap", - MEMBER(defines) imap_setting_defines, - MEMBER(defaults) &imap_default_settings, + .module_name = "imap", + .defines = imap_setting_defines, + .defaults = &imap_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct imap_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct imap_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) imap_settings_verify, - MEMBER(dependencies) imap_setting_dependencies + .check_func = imap_settings_verify, + .dependencies = imap_setting_dependencies }; /* */ diff --git a/src/lib-dict/dict-client.c b/src/lib-dict/dict-client.c index 76b943b89f..695fe8a381 100644 --- a/src/lib-dict/dict-client.c +++ b/src/lib-dict/dict-client.c @@ -691,7 +691,7 @@ static void client_dict_atomic_inc(struct dict_transaction_context *_ctx, } struct dict dict_driver_client = { - MEMBER(name) "proxy", + .name = "proxy", { client_dict_init, diff --git a/src/lib-dict/dict-db.c b/src/lib-dict/dict-db.c index d601173d45..c150b0e9be 100644 --- a/src/lib-dict/dict-db.c +++ b/src/lib-dict/dict-db.c @@ -449,7 +449,7 @@ db_dict_atomic_inc(struct dict_transaction_context *_ctx ATTR_UNUSED, } struct dict dict_driver_db = { - MEMBER(name) "db", + .name = "db", { db_dict_init, db_dict_deinit, diff --git a/src/lib-dict/dict-file.c b/src/lib-dict/dict-file.c index 6c4e8bbb52..10b94470d3 100644 --- a/src/lib-dict/dict-file.c +++ b/src/lib-dict/dict-file.c @@ -59,11 +59,8 @@ struct file_dict_transaction_context { }; static struct dotlock_settings file_dict_dotlock_settings = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) 30, - MEMBER(stale_timeout) 5 + .timeout = 30, + .stale_timeout = 5 }; static struct dict *file_dict_init(struct dict *driver, const char *uri, @@ -440,7 +437,7 @@ file_dict_atomic_inc(struct dict_transaction_context *_ctx, } struct dict dict_driver_file = { - MEMBER(name) "file", + .name = "file", { file_dict_init, file_dict_deinit, diff --git a/src/lib-dict/dict-sql.c b/src/lib-dict/dict-sql.c index adcd2f3900..ede9afb029 100644 --- a/src/lib-dict/dict-sql.c +++ b/src/lib-dict/dict-sql.c @@ -850,7 +850,7 @@ static void sql_dict_atomic_inc(struct dict_transaction_context *_ctx, } static struct dict sql_dict = { - MEMBER(name) "sql", + .name = "sql", { sql_dict_init, diff --git a/src/lib-index/mail-index-strmap.c b/src/lib-index/mail-index-strmap.c index 60c893ccfc..0c39eafb3b 100644 --- a/src/lib-index/mail-index-strmap.c +++ b/src/lib-index/mail-index-strmap.c @@ -90,11 +90,8 @@ struct mail_index_strmap_hash_key { #define MAIL_INDEX_STRMAP_TIMEOUT_SECS 10 const struct dotlock_settings default_dotlock_settings = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) MAIL_INDEX_STRMAP_TIMEOUT_SECS, - MEMBER(stale_timeout) 30 + .timeout = MAIL_INDEX_STRMAP_TIMEOUT_SECS, + .stale_timeout = 30 }; struct mail_index_strmap * diff --git a/src/lib-index/mailbox-list-index.c b/src/lib-index/mailbox-list-index.c index 465e051e19..e8d76e7eba 100644 --- a/src/lib-index/mailbox-list-index.c +++ b/src/lib-index/mailbox-list-index.c @@ -42,11 +42,8 @@ struct mailbox_list_iter_ctx { }; static const struct dotlock_settings default_dotlock_set = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) 60, - MEMBER(stale_timeout) 30 + .timeout = 60, + .stale_timeout = 30 }; int mailbox_list_index_set_syscall_error(struct mailbox_list_index *index, diff --git a/src/lib-lda/duplicate.c b/src/lib-lda/duplicate.c index 0ab52f12ca..24b1d85ca4 100644 --- a/src/lib-lda/duplicate.c +++ b/src/lib-lda/duplicate.c @@ -55,16 +55,8 @@ struct duplicate_context { }; static const struct dotlock_settings default_duplicate_dotlock_set = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) 20, - MEMBER(stale_timeout) 10, - - MEMBER(callback) NULL, - MEMBER(context) NULL, - - MEMBER(use_excl_lock) FALSE + .timeout = 20, + .stale_timeout = 10, }; static int duplicate_cmp(const void *p1, const void *p2) diff --git a/src/lib-lda/lda-settings.c b/src/lib-lda/lda-settings.c index e4f8d9ae43..2ba0d8e0cd 100644 --- a/src/lib-lda/lda-settings.c +++ b/src/lib-lda/lda-settings.c @@ -33,17 +33,17 @@ static const struct setting_define lda_setting_defines[] = { }; static const struct lda_settings lda_default_settings = { - MEMBER(postmaster_address) "", - MEMBER(hostname) "", - MEMBER(sendmail_path) "/usr/lib/sendmail", - MEMBER(rejection_subject) "Rejected: %s", - MEMBER(rejection_reason) + .postmaster_address = "", + .hostname = "", + .sendmail_path = "/usr/lib/sendmail", + .rejection_subject = "Rejected: %s", + .rejection_reason = "Your message to <%t> was automatically rejected:%n%r", - MEMBER(deliver_log_format) "msgid=%m: %$", - MEMBER(recipient_delimiter) "", - MEMBER(quota_full_tempfail) FALSE, - MEMBER(lda_mailbox_autocreate) FALSE, - MEMBER(lda_mailbox_autosubscribe) FALSE + .deliver_log_format = "msgid=%m: %$", + .recipient_delimiter = "", + .quota_full_tempfail = FALSE, + .lda_mailbox_autocreate = FALSE, + .lda_mailbox_autosubscribe = FALSE }; static const struct setting_parser_info *lda_setting_dependencies[] = { @@ -52,22 +52,19 @@ static const struct setting_parser_info *lda_setting_dependencies[] = { }; const struct setting_parser_info lda_setting_parser_info = { - MEMBER(module_name) "lda", - MEMBER(defines) lda_setting_defines, - MEMBER(defaults) &lda_default_settings, + .module_name = "lda", + .defines = lda_setting_defines, + .defaults = &lda_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct lda_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct lda_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, -#ifdef CONFIG_BINARY - MEMBER(check_func) NULL, -#else - MEMBER(check_func) lda_settings_check, +#ifndef CONFIG_BINARY + .check_func = lda_settings_check, #endif - MEMBER(dependencies) lda_setting_dependencies + .dependencies = lda_setting_dependencies }; static bool lda_settings_check(void *_set, pool_t pool ATTR_UNUSED, diff --git a/src/lib-master/master-service-settings.c b/src/lib-master/master-service-settings.c index bacf218f82..eac81e7ce5 100644 --- a/src/lib-master/master-service-settings.c +++ b/src/lib-master/master-service-settings.c @@ -37,24 +37,24 @@ static const struct setting_define master_service_setting_defines[] = { }; static const struct master_service_settings master_service_default_settings = { - MEMBER(log_path) "", - MEMBER(info_log_path) "", - MEMBER(debug_log_path) "", - MEMBER(log_timestamp) DEFAULT_FAILURE_STAMP_FORMAT, - MEMBER(syslog_facility) "mail", - MEMBER(version_ignore) FALSE, - MEMBER(shutdown_clients) TRUE + .log_path = "", + .info_log_path = "", + .debug_log_path = "", + .log_timestamp = DEFAULT_FAILURE_STAMP_FORMAT, + .syslog_facility = "mail", + .version_ignore = FALSE, + .shutdown_clients = TRUE }; const struct setting_parser_info master_service_setting_parser_info = { - MEMBER(module_name) "master", - MEMBER(defines) master_service_setting_defines, - MEMBER(defaults) &master_service_default_settings, + .module_name = "master", + .defines = master_service_setting_defines, + .defaults = &master_service_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct master_service_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct master_service_settings), - MEMBER(parent_offset) (size_t)-1 + .parent_offset = (size_t)-1 }; static void ATTR_NORETURN diff --git a/src/lib-settings/settings-parser.c b/src/lib-settings/settings-parser.c index 7cab6eec53..4a1f3d5b9b 100644 --- a/src/lib-settings/settings-parser.c +++ b/src/lib-settings/settings-parser.c @@ -54,14 +54,14 @@ struct setting_parser_context { }; static const struct setting_parser_info strlist_info = { - MEMBER(module_name) NULL, - MEMBER(defines) NULL, - MEMBER(defaults) NULL, + .module_name = NULL, + .defines = NULL, + .defaults = NULL, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) 0, + .type_offset = (size_t)-1, + .struct_size = 0, - MEMBER(parent_offset) (size_t)-1 + .parent_offset = (size_t)-1 }; static void diff --git a/src/lib-sql/driver-mysql.c b/src/lib-sql/driver-mysql.c index 935bb4f099..060b748abc 100644 --- a/src/lib-sql/driver-mysql.c +++ b/src/lib-sql/driver-mysql.c @@ -675,7 +675,7 @@ driver_mysql_update(struct sql_transaction_context *_ctx, const char *query, struct sql_db driver_mysql_db = { "mysql", - MEMBER(v) { + .v = { driver_mysql_init_v, driver_mysql_deinit_v, driver_mysql_get_flags, @@ -695,7 +695,7 @@ struct sql_db driver_mysql_db = { }; struct sql_result driver_mysql_result = { - MEMBER(v) { + .v = { driver_mysql_result_free, driver_mysql_result_next_row, driver_mysql_result_get_fields_count, @@ -716,7 +716,7 @@ driver_mysql_result_error_next_row(struct sql_result *result ATTR_UNUSED) } struct sql_result driver_mysql_error_result = { - MEMBER(v) { + .v = { driver_mysql_result_free, driver_mysql_result_error_next_row, NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/src/lib-sql/driver-pgsql.c b/src/lib-sql/driver-pgsql.c index 8c9bcd6811..89d4c7dc35 100644 --- a/src/lib-sql/driver-pgsql.c +++ b/src/lib-sql/driver-pgsql.c @@ -1066,7 +1066,7 @@ driver_pgsql_update(struct sql_transaction_context *_ctx, const char *query, struct sql_db driver_pgsql_db = { "pgsql", - MEMBER(v) { + .v = { driver_pgsql_init_v, driver_pgsql_deinit_v, driver_pgsql_get_flags, @@ -1086,7 +1086,7 @@ struct sql_db driver_pgsql_db = { }; struct sql_result driver_pgsql_result = { - MEMBER(v) { + .v = { driver_pgsql_result_free, driver_pgsql_result_next_row, driver_pgsql_result_get_fields_count, diff --git a/src/lib-sql/driver-sqlite.c b/src/lib-sql/driver-sqlite.c index 6a08490efb..53c055f675 100644 --- a/src/lib-sql/driver-sqlite.c +++ b/src/lib-sql/driver-sqlite.c @@ -389,7 +389,7 @@ driver_sqlite_update(struct sql_transaction_context *_ctx, const char *query, struct sql_db driver_sqlite_db = { "sqlite", - MEMBER(v) { + .v = { driver_sqlite_init_v, driver_sqlite_deinit_v, driver_sqlite_get_flags, @@ -408,7 +408,7 @@ struct sql_db driver_sqlite_db = { }; struct sql_result driver_sqlite_result = { - MEMBER(v) { + .v = { driver_sqlite_result_free, driver_sqlite_result_next_row, driver_sqlite_result_get_fields_count, @@ -429,7 +429,7 @@ driver_sqlite_result_error_next_row(struct sql_result *result ATTR_UNUSED) } struct sql_result driver_sqlite_error_result = { - MEMBER(v) { + .v = { driver_sqlite_result_free, driver_sqlite_result_error_next_row, NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/src/lib-sql/sql-api.c b/src/lib-sql/sql-api.c index 42465b9b34..34993c890f 100644 --- a/src/lib-sql/sql-api.c +++ b/src/lib-sql/sql-api.c @@ -335,7 +335,7 @@ void sql_update_get_rows(struct sql_transaction_context *ctx, const char *query, } struct sql_result sql_not_connected_result = { - MEMBER(v) { + .v = { sql_result_not_connected_free, sql_result_not_connected_next_row, NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/src/lib-storage/index/cydir/cydir-storage.c b/src/lib-storage/index/cydir/cydir-storage.c index 64ff217195..3065c997cd 100644 --- a/src/lib-storage/index/cydir/cydir-storage.c +++ b/src/lib-storage/index/cydir/cydir-storage.c @@ -332,10 +332,10 @@ static void cydir_storage_add_list(struct mail_storage *storage ATTR_UNUSED, } struct mail_storage cydir_storage = { - MEMBER(name) CYDIR_STORAGE_NAME, - MEMBER(class_flags) 0, + .name = CYDIR_STORAGE_NAME, + .class_flags = 0, - { + .v = { NULL, cydir_storage_alloc, NULL, @@ -349,11 +349,7 @@ struct mail_storage cydir_storage = { }; struct mailbox cydir_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/lib-storage/index/dbox-multi/mdbox-settings.c b/src/lib-storage/index/dbox-multi/mdbox-settings.c index 5b63f0d9e1..5b9b96f853 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-settings.c +++ b/src/lib-storage/index/dbox-multi/mdbox-settings.c @@ -25,25 +25,25 @@ static const struct setting_define mdbox_setting_defines[] = { }; static const struct mdbox_settings mdbox_default_settings = { - MEMBER(mdbox_rotate_size) 2*1024*1024, - MEMBER(mdbox_rotate_min_size) 16*1024, - MEMBER(mdbox_rotate_days) 0, - MEMBER(mdbox_max_open_files) 64, - MEMBER(mdbox_purge_min_percentage) 0 + .mdbox_rotate_size = 2*1024*1024, + .mdbox_rotate_min_size = 16*1024, + .mdbox_rotate_days = 0, + .mdbox_max_open_files = 64, + .mdbox_purge_min_percentage = 0 }; static const struct setting_parser_info mdbox_setting_parser_info = { - MEMBER(module_name) "mdbox", - MEMBER(defines) mdbox_setting_defines, - MEMBER(defaults) &mdbox_default_settings, + .module_name = "mdbox", + .defines = mdbox_setting_defines, + .defaults = &mdbox_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct mdbox_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct mdbox_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &mail_user_setting_parser_info, + .parent_offset = (size_t)-1, + .parent = &mail_user_setting_parser_info, - MEMBER(check_func) mdbox_settings_verify + .check_func = mdbox_settings_verify }; /* */ diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index 6c9f62e054..be46bbff71 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -429,10 +429,10 @@ static void dbox_storage_add_list(struct mail_storage *storage ATTR_UNUSED, } struct mail_storage mdbox_storage = { - MEMBER(name) MDBOX_STORAGE_NAME, - MEMBER(class_flags) MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT, + .name = MDBOX_STORAGE_NAME, + .class_flags = MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT, - { + .v = { mdbox_get_setting_parser_info, mdbox_storage_alloc, mdbox_storage_create, @@ -446,11 +446,7 @@ struct mail_storage mdbox_storage = { }; struct mailbox mdbox_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index 470f661ea6..0c93129d96 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -301,10 +301,10 @@ static void sdbox_storage_add_list(struct mail_storage *storage ATTR_UNUSED, } struct mail_storage dbox_storage = { - MEMBER(name) SDBOX_STORAGE_NAME, - MEMBER(class_flags) 0, + .name = SDBOX_STORAGE_NAME, + .class_flags = 0, - { + .v = { NULL, sdbox_storage_alloc, NULL, @@ -318,11 +318,7 @@ struct mail_storage dbox_storage = { }; struct mailbox sdbox_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/lib-storage/index/maildir/maildir-settings.c b/src/lib-storage/index/maildir/maildir-settings.c index 9134669ce4..253adef7b4 100644 --- a/src/lib-storage/index/maildir/maildir-settings.c +++ b/src/lib-storage/index/maildir/maildir-settings.c @@ -21,22 +21,22 @@ static const struct setting_define maildir_setting_defines[] = { }; static const struct maildir_settings maildir_default_settings = { - MEMBER(maildir_stat_dirs) FALSE, - MEMBER(maildir_copy_with_hardlinks) TRUE, - MEMBER(maildir_copy_preserve_filename) FALSE, - MEMBER(maildir_very_dirty_syncs) FALSE + .maildir_stat_dirs = FALSE, + .maildir_copy_with_hardlinks = TRUE, + .maildir_copy_preserve_filename = FALSE, + .maildir_very_dirty_syncs = FALSE }; static const struct setting_parser_info maildir_setting_parser_info = { - MEMBER(module_name) "maildir", - MEMBER(defines) maildir_setting_defines, - MEMBER(defaults) &maildir_default_settings, + .module_name = "maildir", + .defines = maildir_setting_defines, + .defaults = &maildir_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct maildir_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct maildir_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &mail_user_setting_parser_info + .parent_offset = (size_t)-1, + .parent = &mail_user_setting_parser_info }; const struct setting_parser_info *maildir_get_setting_parser_info(void) diff --git a/src/lib-storage/index/maildir/maildir-storage.c b/src/lib-storage/index/maildir/maildir-storage.c index c05dbd59d7..06c41046e7 100644 --- a/src/lib-storage/index/maildir/maildir-storage.c +++ b/src/lib-storage/index/maildir/maildir-storage.c @@ -1111,10 +1111,10 @@ static void maildir_storage_add_list(struct mail_storage *storage, } struct mail_storage maildir_storage = { - MEMBER(name) MAILDIR_STORAGE_NAME, - MEMBER(class_flags) 0, + .name = MAILDIR_STORAGE_NAME, + .class_flags = 0, - { + .v = { maildir_get_setting_parser_info, maildir_storage_alloc, maildir_storage_create, @@ -1128,11 +1128,7 @@ struct mail_storage maildir_storage = { }; struct mailbox maildir_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/lib-storage/index/mbox/mbox-settings.c b/src/lib-storage/index/mbox/mbox-settings.c index df1d4dea02..e23ddf844d 100644 --- a/src/lib-storage/index/mbox/mbox-settings.c +++ b/src/lib-storage/index/mbox/mbox-settings.c @@ -25,26 +25,26 @@ static const struct setting_define mbox_setting_defines[] = { }; static const struct mbox_settings mbox_default_settings = { - MEMBER(mbox_read_locks) "fcntl", - MEMBER(mbox_write_locks) "dotlock fcntl", - MEMBER(mbox_lock_timeout) 5*60, - MEMBER(mbox_dotlock_change_timeout) 2*60, - MEMBER(mbox_min_index_size) 0, - MEMBER(mbox_dirty_syncs) TRUE, - MEMBER(mbox_very_dirty_syncs) FALSE, - MEMBER(mbox_lazy_writes) TRUE + .mbox_read_locks = "fcntl", + .mbox_write_locks = "dotlock fcntl", + .mbox_lock_timeout = 5*60, + .mbox_dotlock_change_timeout = 2*60, + .mbox_min_index_size = 0, + .mbox_dirty_syncs = TRUE, + .mbox_very_dirty_syncs = FALSE, + .mbox_lazy_writes = TRUE }; static const struct setting_parser_info mbox_setting_parser_info = { - MEMBER(module_name) "mbox", - MEMBER(defines) mbox_setting_defines, - MEMBER(defaults) &mbox_default_settings, + .module_name = "mbox", + .defines = mbox_setting_defines, + .defaults = &mbox_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct mbox_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct mbox_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &mail_user_setting_parser_info + .parent_offset = (size_t)-1, + .parent = &mail_user_setting_parser_info }; const struct setting_parser_info *mbox_get_setting_parser_info(void) diff --git a/src/lib-storage/index/mbox/mbox-storage.c b/src/lib-storage/index/mbox/mbox-storage.c index 15ebffa833..ef6ba48a5b 100644 --- a/src/lib-storage/index/mbox/mbox-storage.c +++ b/src/lib-storage/index/mbox/mbox-storage.c @@ -913,10 +913,10 @@ mbox_transaction_rollback(struct mailbox_transaction_context *t) } struct mail_storage mbox_storage = { - MEMBER(name) MBOX_STORAGE_NAME, - MEMBER(class_flags) MAIL_STORAGE_CLASS_FLAG_MAILBOX_IS_FILE, + .name = MBOX_STORAGE_NAME, + .class_flags = MAIL_STORAGE_CLASS_FLAG_MAILBOX_IS_FILE, - { + .v = { mbox_get_setting_parser_info, mbox_storage_alloc, mbox_storage_create, @@ -930,11 +930,7 @@ struct mail_storage mbox_storage = { }; struct mailbox mbox_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/lib-storage/index/raw/raw-storage.c b/src/lib-storage/index/raw/raw-storage.c index 1db2373109..43b2e5c830 100644 --- a/src/lib-storage/index/raw/raw-storage.c +++ b/src/lib-storage/index/raw/raw-storage.c @@ -171,10 +171,10 @@ static void raw_storage_add_list(struct mail_storage *storage ATTR_UNUSED, } struct mail_storage raw_storage = { - MEMBER(name) RAW_STORAGE_NAME, - MEMBER(class_flags) MAIL_STORAGE_CLASS_FLAG_MAILBOX_IS_FILE, + .name = RAW_STORAGE_NAME, + .class_flags = MAIL_STORAGE_CLASS_FLAG_MAILBOX_IS_FILE, - { + .v = { NULL, raw_storage_alloc, NULL, @@ -188,11 +188,7 @@ struct mail_storage raw_storage = { }; struct mailbox raw_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/lib-storage/index/shared/shared-list.c b/src/lib-storage/index/shared/shared-list.c index 46d1839b21..bdb890d1f1 100644 --- a/src/lib-storage/index/shared/shared-list.c +++ b/src/lib-storage/index/shared/shared-list.c @@ -302,10 +302,10 @@ shared_list_rename_mailbox_pre(struct mailbox_list *oldlist, } struct mailbox_list shared_mailbox_list = { - MEMBER(name) "shared", - MEMBER(hierarchy_sep) '/', - MEMBER(props) 0, - MEMBER(mailbox_name_max_length) PATH_MAX, + .name = "shared", + .hierarchy_sep = '/', + .props = 0, + .mailbox_name_max_length = PATH_MAX, { shared_list_alloc, diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index 11d9f2e24c..44a03954a0 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -289,10 +289,10 @@ int shared_storage_get_namespace(struct mail_namespace **_ns, } struct mail_storage shared_storage = { - MEMBER(name) SHARED_STORAGE_NAME, - MEMBER(class_flags) 0, /* unknown at this point */ + .name = SHARED_STORAGE_NAME, + .class_flags = 0, /* unknown at this point */ - { + .v = { NULL, shared_storage_alloc, shared_storage_create, diff --git a/src/lib-storage/list/mailbox-list-fs.c b/src/lib-storage/list/mailbox-list-fs.c index 9bc15a8d9f..26bcd073bb 100644 --- a/src/lib-storage/list/mailbox-list-fs.c +++ b/src/lib-storage/list/mailbox-list-fs.c @@ -414,10 +414,10 @@ static int fs_list_rename_mailbox(struct mailbox_list *oldlist, } struct mailbox_list fs_mailbox_list = { - MEMBER(name) MAILBOX_LIST_NAME_FS, - MEMBER(hierarchy_sep) '/', - MEMBER(props) 0, - MEMBER(mailbox_name_max_length) PATH_MAX, + .name = MAILBOX_LIST_NAME_FS, + .hierarchy_sep = '/', + .props = 0, + .mailbox_name_max_length = PATH_MAX, { fs_list_alloc, diff --git a/src/lib-storage/list/mailbox-list-maildir.c b/src/lib-storage/list/mailbox-list-maildir.c index fa5894f381..b8ffd61b77 100644 --- a/src/lib-storage/list/mailbox-list-maildir.c +++ b/src/lib-storage/list/mailbox-list-maildir.c @@ -439,10 +439,10 @@ maildir_list_rename_mailbox(struct mailbox_list *oldlist, const char *oldname, } struct mailbox_list maildir_mailbox_list = { - MEMBER(name) MAILBOX_LIST_NAME_MAILDIRPLUSPLUS, - MEMBER(hierarchy_sep) '.', - MEMBER(props) MAILBOX_LIST_PROP_NO_MAILDIR_NAME, - MEMBER(mailbox_name_max_length) PATH_MAX, + .name = MAILBOX_LIST_NAME_MAILDIRPLUSPLUS, + .hierarchy_sep = '.', + .props = MAILBOX_LIST_PROP_NO_MAILDIR_NAME, + .mailbox_name_max_length = PATH_MAX, { maildir_list_alloc, @@ -468,10 +468,10 @@ struct mailbox_list maildir_mailbox_list = { }; struct mailbox_list imapdir_mailbox_list = { - MEMBER(name) MAILBOX_LIST_NAME_IMAPDIR, - MEMBER(hierarchy_sep) '.', - MEMBER(props) MAILBOX_LIST_PROP_NO_MAILDIR_NAME, - MEMBER(mailbox_name_max_length) PATH_MAX, + .name = MAILBOX_LIST_NAME_IMAPDIR, + .hierarchy_sep = '.', + .props = MAILBOX_LIST_PROP_NO_MAILDIR_NAME, + .mailbox_name_max_length = PATH_MAX, { imapdir_list_alloc, diff --git a/src/lib-storage/mail-storage-settings.c b/src/lib-storage/mail-storage-settings.c index df661a3a43..043685a0a9 100644 --- a/src/lib-storage/mail-storage-settings.c +++ b/src/lib-storage/mail-storage-settings.c @@ -43,37 +43,37 @@ static const struct setting_define mail_storage_setting_defines[] = { }; const struct mail_storage_settings mail_storage_default_settings = { - MEMBER(mail_location) "", - MEMBER(mail_cache_fields) "flags", - MEMBER(mail_never_cache_fields) "imap.envelope", - MEMBER(mail_cache_min_mail_count) 0, - MEMBER(mailbox_idle_check_interval) 30, - MEMBER(mail_max_keyword_length) 50, - MEMBER(mail_save_crlf) FALSE, - MEMBER(fsync_disable) FALSE, - MEMBER(mmap_disable) FALSE, - MEMBER(dotlock_use_excl) FALSE, - MEMBER(mail_nfs_storage) FALSE, - MEMBER(mail_nfs_index) FALSE, - MEMBER(mailbox_list_index_disable) FALSE, - MEMBER(mail_debug) FALSE, - MEMBER(mail_full_filesystem_access) FALSE, - MEMBER(lock_method) "fcntl:flock:dotlock", - MEMBER(pop3_uidl_format) "%08Xu%08Xv" + .mail_location = "", + .mail_cache_fields = "flags", + .mail_never_cache_fields = "imap.envelope", + .mail_cache_min_mail_count = 0, + .mailbox_idle_check_interval = 30, + .mail_max_keyword_length = 50, + .mail_save_crlf = FALSE, + .fsync_disable = FALSE, + .mmap_disable = FALSE, + .dotlock_use_excl = FALSE, + .mail_nfs_storage = FALSE, + .mail_nfs_index = FALSE, + .mailbox_list_index_disable = FALSE, + .mail_debug = FALSE, + .mail_full_filesystem_access = FALSE, + .lock_method = "fcntl:flock:dotlock", + .pop3_uidl_format = "%08Xu%08Xv" }; const struct setting_parser_info mail_storage_setting_parser_info = { - MEMBER(module_name) "mail", - MEMBER(defines) mail_storage_setting_defines, - MEMBER(defaults) &mail_storage_default_settings, + .module_name = "mail", + .defines = mail_storage_setting_defines, + .defaults = &mail_storage_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct mail_storage_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct mail_storage_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &mail_user_setting_parser_info, + .parent_offset = (size_t)-1, + .parent = &mail_user_setting_parser_info, - MEMBER(check_func) mail_storage_settings_check + .check_func = mail_storage_settings_check }; #undef DEF @@ -96,30 +96,29 @@ static const struct setting_define mail_namespace_setting_defines[] = { }; const struct mail_namespace_settings mail_namespace_default_settings = { - MEMBER(type) "private:shared:public", - MEMBER(separator) "", - MEMBER(prefix) "", - MEMBER(location) "", - MEMBER(alias_for) NULL, - - MEMBER(inbox) FALSE, - MEMBER(hidden) FALSE, - MEMBER(list) "yes:no:children", - MEMBER(subscriptions) TRUE + .type = "private:shared:public", + .separator = "", + .prefix = "", + .location = "", + .alias_for = NULL, + + .inbox = FALSE, + .hidden = FALSE, + .list = "yes:no:children", + .subscriptions = TRUE }; const struct setting_parser_info mail_namespace_setting_parser_info = { - MEMBER(module_name) NULL, - MEMBER(defines) mail_namespace_setting_defines, - MEMBER(defaults) &mail_namespace_default_settings, + .defines = mail_namespace_setting_defines, + .defaults = &mail_namespace_default_settings, - MEMBER(type_offset) offsetof(struct mail_namespace_settings, prefix), - MEMBER(struct_size) sizeof(struct mail_namespace_settings), + .type_offset = offsetof(struct mail_namespace_settings, prefix), + .struct_size = sizeof(struct mail_namespace_settings), - MEMBER(parent_offset) offsetof(struct mail_namespace_settings, user_set), - MEMBER(parent) &mail_user_setting_parser_info, + .parent_offset = offsetof(struct mail_namespace_settings, user_set), + .parent = &mail_user_setting_parser_info, - MEMBER(check_func) namespace_settings_check + .check_func = namespace_settings_check }; #undef DEF @@ -159,43 +158,42 @@ static const struct setting_define mail_user_setting_defines[] = { }; static const struct mail_user_settings mail_user_default_settings = { - MEMBER(base_dir) PKG_RUNDIR, - MEMBER(auth_socket_path) "auth-userdb", + .base_dir = PKG_RUNDIR, + .auth_socket_path = "auth-userdb", - MEMBER(mail_uid) "", - MEMBER(mail_gid) "", - MEMBER(mail_home) "", - MEMBER(mail_chroot) "", - MEMBER(mail_access_groups) "", - MEMBER(mail_privileged_group) "", - MEMBER(valid_chroot_dirs) "", + .mail_uid = "", + .mail_gid = "", + .mail_home = "", + .mail_chroot = "", + .mail_access_groups = "", + .mail_privileged_group = "", + .valid_chroot_dirs = "", - MEMBER(first_valid_uid) 500, - MEMBER(last_valid_uid) 0, - MEMBER(first_valid_gid) 1, - MEMBER(last_valid_gid) 0, + .first_valid_uid = 500, + .last_valid_uid = 0, + .first_valid_gid = 1, + .last_valid_gid = 0, - MEMBER(mail_plugins) "", - MEMBER(mail_plugin_dir) MODULEDIR, + .mail_plugins = "", + .mail_plugin_dir = MODULEDIR, - MEMBER(mail_log_prefix) "%s(%u): ", + .mail_log_prefix = "%s(%u): ", - MEMBER(namespaces) ARRAY_INIT, - MEMBER(plugin_envs) ARRAY_INIT + .namespaces = ARRAY_INIT, + .plugin_envs = ARRAY_INIT }; const struct setting_parser_info mail_user_setting_parser_info = { - MEMBER(module_name) "mail", - MEMBER(defines) mail_user_setting_defines, - MEMBER(defaults) &mail_user_default_settings, + .module_name = "mail", + .defines = mail_user_setting_defines, + .defaults = &mail_user_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct mail_user_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct mail_user_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) mail_user_settings_check + .check_func = mail_user_settings_check }; const void * diff --git a/src/lib-storage/test-mail-storage.c b/src/lib-storage/test-mail-storage.c index 92a5a3b24d..0bf4a2a05f 100644 --- a/src/lib-storage/test-mail-storage.c +++ b/src/lib-storage/test-mail-storage.c @@ -31,10 +31,10 @@ test_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED, } struct mail_storage test_storage = { - MEMBER(name) "test", - MEMBER(class_flags) 0, + .name = "test", + .class_flags = 0, - { + .v = { NULL, test_storage_alloc, NULL, diff --git a/src/lib-storage/test-mailbox.c b/src/lib-storage/test-mailbox.c index b367cb63d1..feef2157d2 100644 --- a/src/lib-storage/test-mailbox.c +++ b/src/lib-storage/test-mailbox.c @@ -300,11 +300,7 @@ static bool test_mailbox_is_inconsistent(struct mailbox *box ATTR_UNUSED) } struct mailbox test_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { test_mailbox_is_readonly, test_mailbox_allow_new_keywords, test_mailbox_enable, diff --git a/src/lib/macros.h b/src/lib/macros.h index 3221a6f491..4ddb0b908d 100644 --- a/src/lib/macros.h +++ b/src/lib/macros.h @@ -138,14 +138,6 @@ # define ATTR_COLD #endif -/* C99-style struct member definitions */ -#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L && \ - !defined(_HPUX_SOURCE)) || __GNUC__ > 2 -# define MEMBER(name) .name = -#else -# define MEMBER(name) -#endif - /* Macros to provide type safety for callback functions' context parameters */ #ifdef __GNUC__ # define CONTEXT_TYPE_SAFETY diff --git a/src/lib/mempool-alloconly.c b/src/lib/mempool-alloconly.c index 99fbde24a5..49bc8fdf0a 100644 --- a/src/lib/mempool-alloconly.c +++ b/src/lib/mempool-alloconly.c @@ -80,10 +80,10 @@ static const struct pool_vfuncs static_alloconly_pool_vfuncs = { }; static const struct pool static_alloconly_pool = { - MEMBER(v) &static_alloconly_pool_vfuncs, + .v = &static_alloconly_pool_vfuncs, - MEMBER(alloconly_pool) TRUE, - MEMBER(datastack_pool) FALSE + .alloconly_pool = TRUE, + .datastack_pool = FALSE }; #ifdef DEBUG diff --git a/src/lib/mempool-datastack.c b/src/lib/mempool-datastack.c index c7a1c29e90..faefe523d1 100644 --- a/src/lib/mempool-datastack.c +++ b/src/lib/mempool-datastack.c @@ -31,10 +31,10 @@ static struct pool_vfuncs static_data_stack_pool_vfuncs = { }; static const struct pool static_data_stack_pool = { - MEMBER(v) &static_data_stack_pool_vfuncs, + .v = &static_data_stack_pool_vfuncs, - MEMBER(alloconly_pool) TRUE, - MEMBER(datastack_pool) TRUE + .alloconly_pool = TRUE, + .datastack_pool = TRUE }; struct datastack_pool { diff --git a/src/lib/mempool-system-clean.c b/src/lib/mempool-system-clean.c index 666860cd9f..32dc255212 100644 --- a/src/lib/mempool-system-clean.c +++ b/src/lib/mempool-system-clean.c @@ -58,10 +58,10 @@ static struct pool_vfuncs static_system_clean_pool_vfuncs = { }; static struct pool static_system_clean_pool = { - MEMBER(v) &static_system_clean_pool_vfuncs, + .v = &static_system_clean_pool_vfuncs, - MEMBER(alloconly_pool) FALSE, - MEMBER(datastack_pool) FALSE + .alloconly_pool = FALSE, + .datastack_pool = FALSE }; pool_t system_clean_pool = &static_system_clean_pool; diff --git a/src/lib/mempool-system.c b/src/lib/mempool-system.c index c802355fdf..ba6a29ad12 100644 --- a/src/lib/mempool-system.c +++ b/src/lib/mempool-system.c @@ -46,10 +46,10 @@ static struct pool_vfuncs static_system_pool_vfuncs = { }; struct pool static_system_pool = { - MEMBER(v) &static_system_pool_vfuncs, + .v = &static_system_pool_vfuncs, - MEMBER(alloconly_pool) FALSE, - MEMBER(datastack_pool) FALSE + .alloconly_pool = FALSE, + .datastack_pool = FALSE }; pool_t system_pool = &static_system_pool; diff --git a/src/lib/mempool-unsafe-datastack.c b/src/lib/mempool-unsafe-datastack.c index 976faa31d1..a1b2576503 100644 --- a/src/lib/mempool-unsafe-datastack.c +++ b/src/lib/mempool-unsafe-datastack.c @@ -31,10 +31,10 @@ static struct pool_vfuncs static_unsafe_data_stack_pool_vfuncs = { }; static struct pool static_unsafe_data_stack_pool = { - MEMBER(v) &static_unsafe_data_stack_pool_vfuncs, + .v = &static_unsafe_data_stack_pool_vfuncs, - MEMBER(alloconly_pool) TRUE, - MEMBER(datastack_pool) TRUE + .alloconly_pool = TRUE, + .datastack_pool = TRUE }; pool_t unsafe_data_stack_pool = &static_unsafe_data_stack_pool; diff --git a/src/lmtp/lmtp-settings.c b/src/lmtp/lmtp-settings.c index d44f25a718..f7bdf99845 100644 --- a/src/lmtp/lmtp-settings.c +++ b/src/lmtp/lmtp-settings.c @@ -25,28 +25,28 @@ static buffer_t lmtp_login_unix_listeners_buf = { /* */ struct service_settings lmtp_login_service_settings = { - MEMBER(name) "lmtp", - MEMBER(protocol) "lmtp", - MEMBER(type) "", - MEMBER(executable) "lmtp", - 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) 0, - MEMBER(service_count) 0, - MEMBER(vsz_limit) 0, - - MEMBER(unix_listeners) { { &lmtp_login_unix_listeners_buf, - sizeof(lmtp_login_unix_listeners[0]) } }, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "lmtp", + .protocol = "lmtp", + .type = "", + .executable = "lmtp", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 0, + .vsz_limit = 0, + + .unix_listeners = { { &lmtp_login_unix_listeners_buf, + sizeof(lmtp_login_unix_listeners[0]) } }, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; #undef DEF @@ -60,7 +60,7 @@ static const struct setting_define lmtp_setting_defines[] = { }; static const struct lmtp_settings lmtp_default_settings = { - MEMBER(lmtp_proxy) FALSE + .lmtp_proxy = FALSE }; static const struct setting_parser_info *lmtp_setting_dependencies[] = { @@ -69,18 +69,16 @@ static const struct setting_parser_info *lmtp_setting_dependencies[] = { }; const struct setting_parser_info lmtp_setting_parser_info = { - MEMBER(module_name) "lmtp", - MEMBER(defines) lmtp_setting_defines, - MEMBER(defaults) &lmtp_default_settings, + .module_name = "lmtp", + .defines = lmtp_setting_defines, + .defaults = &lmtp_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct lmtp_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct lmtp_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) NULL, - MEMBER(dependencies) lmtp_setting_dependencies + .dependencies = lmtp_setting_dependencies }; void lmtp_settings_dup(pool_t pool, const struct lmtp_settings **lmtp_set_r, diff --git a/src/log/log-settings.c b/src/log/log-settings.c index 1e0aa9a327..e4008079f4 100644 --- a/src/log/log-settings.c +++ b/src/log/log-settings.c @@ -7,26 +7,26 @@ #include struct service_settings log_service_settings = { - MEMBER(name) "log", - MEMBER(protocol) "", - MEMBER(type) "log", - MEMBER(executable) "log", - MEMBER(user) "", - MEMBER(group) "", - MEMBER(privileged_group) "", - MEMBER(extra_groups) "", - MEMBER(chroot) "", + .name = "log", + .protocol = "", + .type = "log", + .executable = "log", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", - MEMBER(drop_priv_before_exec) FALSE, + .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, + .process_min_avail = 0, + .process_limit = 1, + .client_limit = 0, + .service_count = 0, + .vsz_limit = -1U, - MEMBER(unix_listeners) ARRAY_INIT, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .unix_listeners = ARRAY_INIT, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; diff --git a/src/login-common/login-settings.c b/src/login-common/login-settings.c index 42c38840c7..25c0bf2b33 100644 --- a/src/login-common/login-settings.c +++ b/src/login-common/login-settings.c @@ -46,44 +46,43 @@ static const struct setting_define login_setting_defines[] = { }; static const struct login_settings login_default_settings = { - MEMBER(login_trusted_networks) "", - MEMBER(login_greeting) PACKAGE_NAME" ready.", - MEMBER(login_log_format_elements) "user=<%u> method=%m rip=%r lip=%l %c", - MEMBER(login_log_format) "%$: %s", - - MEMBER(ssl) "yes:no:required", - MEMBER(ssl_ca_file) "", - MEMBER(ssl_cert) "", - MEMBER(ssl_key) "", - MEMBER(ssl_key_password) "", - MEMBER(ssl_parameters_file) "ssl-parameters.dat", - MEMBER(ssl_cipher_list) "ALL:!LOW:!SSLv2:!EXP:!aNULL", - MEMBER(ssl_cert_username_field) "commonName", - MEMBER(ssl_verify_client_cert) FALSE, - MEMBER(ssl_require_client_cert) FALSE, - MEMBER(ssl_username_from_cert) FALSE, - MEMBER(verbose_ssl) FALSE, - - MEMBER(disable_plaintext_auth) TRUE, - MEMBER(verbose_auth) FALSE, - MEMBER(auth_debug) FALSE, - MEMBER(verbose_proctitle) FALSE, - - MEMBER(mail_max_userip_connections) 10 + .login_trusted_networks = "", + .login_greeting = PACKAGE_NAME" ready.", + .login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l %c", + .login_log_format = "%$: %s", + + .ssl = "yes:no:required", + .ssl_ca_file = "", + .ssl_cert = "", + .ssl_key = "", + .ssl_key_password = "", + .ssl_parameters_file = "ssl-parameters.dat", + .ssl_cipher_list = "ALL:!LOW:!SSLv2:!EXP:!aNULL", + .ssl_cert_username_field = "commonName", + .ssl_verify_client_cert = FALSE, + .ssl_require_client_cert = FALSE, + .ssl_username_from_cert = FALSE, + .verbose_ssl = FALSE, + + .disable_plaintext_auth = TRUE, + .verbose_auth = FALSE, + .auth_debug = FALSE, + .verbose_proctitle = FALSE, + + .mail_max_userip_connections = 10 }; const struct setting_parser_info login_setting_parser_info = { - MEMBER(module_name) "login", - MEMBER(defines) login_setting_defines, - MEMBER(defaults) &login_default_settings, + .module_name = "login", + .defines = login_setting_defines, + .defaults = &login_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct login_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct login_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) login_settings_check + .check_func = login_settings_check }; static const struct setting_parser_info *default_login_set_roots[] = { diff --git a/src/master/master-settings.c b/src/master/master-settings.c index 21b760d986..299a1d8e27 100644 --- a/src/master/master-settings.c +++ b/src/master/master-settings.c @@ -36,22 +36,21 @@ static const struct setting_define file_listener_setting_defines[] = { }; static const struct file_listener_settings file_listener_default_settings = { - MEMBER(path) "", - MEMBER(mode) 0600, - MEMBER(user) "", - MEMBER(group) "", + .path = "", + .mode = 0600, + .user = "", + .group = "", }; static const struct setting_parser_info file_listener_setting_parser_info = { - MEMBER(module_name) NULL, - MEMBER(defines) file_listener_setting_defines, - MEMBER(defaults) &file_listener_default_settings, + .defines = file_listener_setting_defines, + .defaults = &file_listener_default_settings, - MEMBER(type_offset) offsetof(struct file_listener_settings, path), - MEMBER(struct_size) sizeof(struct file_listener_settings), + .type_offset = offsetof(struct file_listener_settings, path), + .struct_size = sizeof(struct file_listener_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &service_setting_parser_info + .parent_offset = (size_t)-1, + .parent = &service_setting_parser_info }; #undef DEF @@ -67,21 +66,20 @@ static const struct setting_define inet_listener_setting_defines[] = { }; static const struct inet_listener_settings inet_listener_default_settings = { - MEMBER(address) "", - MEMBER(port) 0, - MEMBER(ssl) FALSE + .address = "", + .port = 0, + .ssl = FALSE }; static const struct setting_parser_info inet_listener_setting_parser_info = { - MEMBER(module_name) NULL, - MEMBER(defines) inet_listener_setting_defines, - MEMBER(defaults) &inet_listener_default_settings, + .defines = inet_listener_setting_defines, + .defaults = &inet_listener_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct inet_listener_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct inet_listener_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) &service_setting_parser_info + .parent_offset = (size_t)-1, + .parent = &service_setting_parser_info }; #undef DEF @@ -124,39 +122,38 @@ static const struct setting_define service_setting_defines[] = { }; static const struct service_settings service_default_settings = { - MEMBER(name) "", - MEMBER(protocol) "", - MEMBER(type) "", - MEMBER(executable) "", - 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) -1U, - MEMBER(client_limit) 0, - MEMBER(service_count) 0, - MEMBER(vsz_limit) (uoff_t)-1, - - MEMBER(unix_listeners) ARRAY_INIT, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "", + .protocol = "", + .type = "", + .executable = "", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = -1U, + .client_limit = 0, + .service_count = 0, + .vsz_limit = (uoff_t)-1, + + .unix_listeners = ARRAY_INIT, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; const struct setting_parser_info service_setting_parser_info = { - MEMBER(module_name) NULL, - MEMBER(defines) service_setting_defines, - MEMBER(defaults) &service_default_settings, + .defines = service_setting_defines, + .defaults = &service_default_settings, - MEMBER(type_offset) offsetof(struct service_settings, name), - MEMBER(struct_size) sizeof(struct service_settings), + .type_offset = offsetof(struct service_settings, name), + .struct_size = sizeof(struct service_settings), - MEMBER(parent_offset) offsetof(struct service_settings, master_set), - MEMBER(parent) &master_setting_parser_info + .parent_offset = offsetof(struct service_settings, master_set), + .parent = &master_setting_parser_info }; #undef DEF @@ -191,44 +188,43 @@ static const struct setting_define master_setting_defines[] = { }; static const struct master_settings master_default_settings = { - MEMBER(base_dir) PKG_RUNDIR, - MEMBER(libexec_dir) PKG_LIBEXECDIR, - MEMBER(protocols) "imap pop3 lmtp", - MEMBER(listen) "*, ::", - MEMBER(ssl) "yes:no:required", - MEMBER(default_process_limit) 100, - MEMBER(default_client_limit) 1000, - MEMBER(default_vsz_limit) 256*1024*1024, - - MEMBER(version_ignore) FALSE, - MEMBER(mail_debug) FALSE, - MEMBER(auth_debug) FALSE, - - MEMBER(first_valid_uid) 500, - MEMBER(last_valid_uid) 0, - MEMBER(first_valid_gid) 1, - MEMBER(last_valid_gid) 0, + .base_dir = PKG_RUNDIR, + .libexec_dir = PKG_LIBEXECDIR, + .protocols = "imap pop3 lmtp", + .listen = "*, ::", + .ssl = "yes:no:required", + .default_process_limit = 100, + .default_client_limit = 1000, + .default_vsz_limit = 256*1024*1024, + + .version_ignore = FALSE, + .mail_debug = FALSE, + .auth_debug = FALSE, + + .first_valid_uid = 500, + .last_valid_uid = 0, + .first_valid_gid = 1, + .last_valid_gid = 0, #ifndef CONFIG_BINARY - MEMBER(services) ARRAY_INIT + .services = ARRAY_INIT #else - MEMBER(services) { { &config_all_services_buf, + .services = { { &config_all_services_buf, sizeof(struct service_settings *) } }, #endif }; const struct setting_parser_info master_setting_parser_info = { - MEMBER(module_name) "master", - MEMBER(defines) master_setting_defines, - MEMBER(defaults) &master_default_settings, + .module_name = "master", + .defines = master_setting_defines, + .defaults = &master_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct master_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct master_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) master_settings_verify + .check_func = master_settings_verify }; /* */ diff --git a/src/plugins/acl/acl-backend-vfile.c b/src/plugins/acl/acl-backend-vfile.c index 363b9e2be4..ee2fd26374 100644 --- a/src/plugins/acl/acl-backend-vfile.c +++ b/src/plugins/acl/acl-backend-vfile.c @@ -60,11 +60,8 @@ static const struct acl_letter_map acl_letter_map[] = { }; static struct dotlock_settings dotlock_set = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) 30, - MEMBER(stale_timeout) 120 + .timeout = 30, + .stale_timeout = 120 }; static struct acl_backend *acl_backend_vfile_alloc(void) diff --git a/src/plugins/convert/convert-storage.c b/src/plugins/convert/convert-storage.c index 2f5849896f..b69f3288f8 100644 --- a/src/plugins/convert/convert-storage.c +++ b/src/plugins/convert/convert-storage.c @@ -15,11 +15,8 @@ #define CONVERT_LOCK_FILENAME ".dovecot.convert" static struct dotlock_settings dotlock_settings = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) 60*5, - MEMBER(stale_timeout) 60*5 + .timeout = 60*5, + .stale_timeout = 60*5 }; static const char *storage_error(struct mail_storage *storage) diff --git a/src/plugins/fts-lucene/fts-backend-lucene.c b/src/plugins/fts-lucene/fts-backend-lucene.c index fd306a3483..1c1d7d976a 100644 --- a/src/plugins/fts-lucene/fts-backend-lucene.c +++ b/src/plugins/fts-lucene/fts-backend-lucene.c @@ -203,8 +203,8 @@ fts_backend_lucene_lookup(struct fts_backend *_backend, } struct fts_backend fts_backend_lucene = { - MEMBER(name) "lucene", - MEMBER(flags) 0, + .name = "lucene", + .flags = 0, { fts_backend_lucene_init, diff --git a/src/plugins/fts-solr/fts-backend-solr.c b/src/plugins/fts-solr/fts-backend-solr.c index ddacd7d64f..f1abf1d3de 100644 --- a/src/plugins/fts-solr/fts-backend-solr.c +++ b/src/plugins/fts-solr/fts-backend-solr.c @@ -797,8 +797,8 @@ static int fts_backend_solr_lookup(struct fts_backend_lookup_context *ctx, } struct fts_backend fts_backend_solr = { - MEMBER(name) "solr", - MEMBER(flags) FTS_BACKEND_FLAG_VIRTUAL_LOOKUPS, + .name = "solr", + .flags = FTS_BACKEND_FLAG_VIRTUAL_LOOKUPS, { fts_backend_solr_init, diff --git a/src/plugins/fts-squat/fts-backend-squat.c b/src/plugins/fts-squat/fts-backend-squat.c index a18769366c..3fe3d06800 100644 --- a/src/plugins/fts-squat/fts-backend-squat.c +++ b/src/plugins/fts-squat/fts-backend-squat.c @@ -241,8 +241,8 @@ fts_backend_squat_lookup(struct fts_backend *_backend, const char *key, } struct fts_backend fts_backend_squat = { - MEMBER(name) "squat", - MEMBER(flags) FTS_BACKEND_FLAG_SUBSTRING_LOOKUPS, + .name = "squat", + .flags = FTS_BACKEND_FLAG_SUBSTRING_LOOKUPS, { fts_backend_squat_init, diff --git a/src/plugins/quota/quota-maildir.c b/src/plugins/quota/quota-maildir.c index 913ad0cdbf..3eac07737c 100644 --- a/src/plugins/quota/quota-maildir.c +++ b/src/plugins/quota/quota-maildir.c @@ -49,11 +49,8 @@ struct maildir_list_context { extern struct quota_backend quota_backend_maildir; static struct dotlock_settings dotlock_settings = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - - MEMBER(timeout) 0, - MEMBER(stale_timeout) 30 + .timeout = 0, + .stale_timeout = 30 }; static int maildir_sum_dir(const char *dir, uint64_t *total_bytes, diff --git a/src/plugins/virtual/virtual-storage.c b/src/plugins/virtual/virtual-storage.c index bf313e41a2..6212db9b1f 100644 --- a/src/plugins/virtual/virtual-storage.c +++ b/src/plugins/virtual/virtual-storage.c @@ -562,10 +562,10 @@ static void virtual_storage_add_list(struct mail_storage *storage ATTR_UNUSED, } struct mail_storage virtual_storage = { - MEMBER(name) VIRTUAL_STORAGE_NAME, - MEMBER(class_flags) 0, + .name = VIRTUAL_STORAGE_NAME, + .class_flags = 0, - { + .v = { NULL, virtual_storage_alloc, NULL, @@ -579,11 +579,7 @@ struct mail_storage virtual_storage = { }; struct mailbox virtual_mailbox = { - MEMBER(name) NULL, - MEMBER(storage) NULL, - MEMBER(list) NULL, - - { + .v = { index_storage_is_readonly, index_storage_allow_new_keywords, index_storage_mailbox_enable, diff --git a/src/pop3-login/pop3-login-settings.c b/src/pop3-login/pop3-login-settings.c index c812dd4954..8bc69cdfbb 100644 --- a/src/pop3-login/pop3-login-settings.c +++ b/src/pop3-login/pop3-login-settings.c @@ -9,27 +9,27 @@ #include struct service_settings pop3_login_service_settings = { - MEMBER(name) "pop3-login", - MEMBER(protocol) "pop3", - MEMBER(type) "login", - MEMBER(executable) "pop3-login", - MEMBER(user) "dovecot", - MEMBER(group) "", - MEMBER(privileged_group) "", - MEMBER(extra_groups) "", - MEMBER(chroot) "login", - - MEMBER(drop_priv_before_exec) FALSE, - - MEMBER(process_min_avail) 0, - MEMBER(process_limit) 0, - MEMBER(client_limit) 0, - MEMBER(service_count) 1, - MEMBER(vsz_limit) 64, - - MEMBER(unix_listeners) ARRAY_INIT, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "pop3-login", + .protocol = "pop3", + .type = "login", + .executable = "pop3-login", + .user = "dovecot", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "login", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 1, + .vsz_limit = 64, + + .unix_listeners = ARRAY_INIT, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; static const struct setting_define pop3_login_setting_defines[] = { @@ -42,18 +42,13 @@ static const struct setting_parser_info *pop3_login_setting_dependencies[] = { }; const struct setting_parser_info pop3_login_setting_parser_info = { - MEMBER(module_name) "pop3-login", - MEMBER(defines) pop3_login_setting_defines, - MEMBER(defaults) NULL, + .module_name = "pop3-login", + .defines = pop3_login_setting_defines, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) 0, + .type_offset = (size_t)-1, + .parent_offset = (size_t)-1, - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, - - MEMBER(check_func) NULL, - MEMBER(dependencies) pop3_login_setting_dependencies + .dependencies = pop3_login_setting_dependencies }; const struct setting_parser_info *pop3_login_setting_roots[] = { diff --git a/src/pop3/pop3-settings.c b/src/pop3/pop3-settings.c index 71027cad8e..4e4c2b4472 100644 --- a/src/pop3/pop3-settings.c +++ b/src/pop3/pop3-settings.c @@ -27,28 +27,28 @@ static buffer_t pop3_unix_listeners_buf = { /* */ struct service_settings pop3_service_settings = { - MEMBER(name) "pop3", - MEMBER(protocol) "pop3", - MEMBER(type) "", - MEMBER(executable) "pop3", - 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) 0, - MEMBER(service_count) 1, - MEMBER(vsz_limit) -1U, - - MEMBER(unix_listeners) { { &pop3_unix_listeners_buf, - sizeof(pop3_unix_listeners[0]) } }, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "pop3", + .protocol = "pop3", + .type = "", + .executable = "pop3", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 1, + .vsz_limit = -1U, + + .unix_listeners = { { &pop3_unix_listeners_buf, + sizeof(pop3_unix_listeners[0]) } }, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; #undef DEF @@ -74,16 +74,16 @@ static const struct setting_define pop3_setting_defines[] = { }; static const struct pop3_settings pop3_default_settings = { - MEMBER(mail_debug) FALSE, - MEMBER(verbose_proctitle) FALSE, - - MEMBER(pop3_no_flag_updates) FALSE, - MEMBER(pop3_enable_last) FALSE, - MEMBER(pop3_reuse_xuidl) FALSE, - MEMBER(pop3_save_uidl) FALSE, - MEMBER(pop3_lock_session) FALSE, - MEMBER(pop3_client_workarounds) "", - MEMBER(pop3_logout_format) "top=%t/%p, retr=%r/%b, del=%d/%m, size=%s" + .mail_debug = FALSE, + .verbose_proctitle = FALSE, + + .pop3_no_flag_updates = FALSE, + .pop3_enable_last = FALSE, + .pop3_reuse_xuidl = FALSE, + .pop3_save_uidl = FALSE, + .pop3_lock_session = FALSE, + .pop3_client_workarounds = "", + .pop3_logout_format = "top=%t/%p, retr=%r/%b, del=%d/%m, size=%s" }; static const struct setting_parser_info *pop3_setting_dependencies[] = { @@ -92,18 +92,17 @@ static const struct setting_parser_info *pop3_setting_dependencies[] = { }; const struct setting_parser_info pop3_setting_parser_info = { - MEMBER(module_name) "pop3", - MEMBER(defines) pop3_setting_defines, - MEMBER(defaults) &pop3_default_settings, + .module_name = "pop3", + .defines = pop3_setting_defines, + .defaults = &pop3_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct pop3_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct pop3_settings), - MEMBER(parent_offset) (size_t)-1, - MEMBER(parent) NULL, + .parent_offset = (size_t)-1, - MEMBER(check_func) pop3_settings_verify, - MEMBER(dependencies) pop3_setting_dependencies + .check_func = pop3_settings_verify, + .dependencies = pop3_setting_dependencies }; /* */ diff --git a/src/ssl-params/ssl-params-settings.c b/src/ssl-params/ssl-params-settings.c index 6fa35aeff1..52879dd4c3 100644 --- a/src/ssl-params/ssl-params-settings.c +++ b/src/ssl-params/ssl-params-settings.c @@ -24,28 +24,28 @@ static buffer_t ssl_params_unix_listeners_buf = { /* */ struct service_settings ssl_params_service_settings = { - MEMBER(name) "ssl-params", - MEMBER(protocol) "", - MEMBER(type) "", - MEMBER(executable) "ssl-params", - 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) 0, - MEMBER(service_count) 0, - MEMBER(vsz_limit) -1U, - - MEMBER(unix_listeners) { { &ssl_params_unix_listeners_buf, - sizeof(ssl_params_unix_listeners[0]) } }, - MEMBER(fifo_listeners) ARRAY_INIT, - MEMBER(inet_listeners) ARRAY_INIT + .name = "ssl-params", + .protocol = "", + .type = "", + .executable = "ssl-params", + .user = "", + .group = "", + .privileged_group = "", + .extra_groups = "", + .chroot = "", + + .drop_priv_before_exec = FALSE, + + .process_min_avail = 0, + .process_limit = 0, + .client_limit = 0, + .service_count = 0, + .vsz_limit = -1U, + + .unix_listeners = { { &ssl_params_unix_listeners_buf, + sizeof(ssl_params_unix_listeners[0]) } }, + .fifo_listeners = ARRAY_INIT, + .inet_listeners = ARRAY_INIT }; #undef DEF @@ -59,18 +59,18 @@ static const struct setting_define ssl_params_setting_defines[] = { }; static const struct ssl_params_settings ssl_params_default_settings = { - MEMBER(ssl_parameters_regenerate) 24*7 + .ssl_parameters_regenerate = 24*7 }; const struct setting_parser_info ssl_params_setting_parser_info = { - MEMBER(module_name) "ssl-params", - MEMBER(defines) ssl_params_setting_defines, - MEMBER(defaults) &ssl_params_default_settings, + .module_name = "ssl-params", + .defines = ssl_params_setting_defines, + .defaults = &ssl_params_default_settings, - MEMBER(type_offset) (size_t)-1, - MEMBER(struct_size) sizeof(struct ssl_params_settings), + .type_offset = (size_t)-1, + .struct_size = sizeof(struct ssl_params_settings), - MEMBER(parent_offset) (size_t)-1 + .parent_offset = (size_t)-1 }; struct ssl_params_settings * diff --git a/src/util/maildirlock.c b/src/util/maildirlock.c index 1d4576b4ea..bb8d4327d9 100644 --- a/src/util/maildirlock.c +++ b/src/util/maildirlock.c @@ -13,13 +13,8 @@ #include static struct dotlock_settings dotlock_settings = { - MEMBER(temp_prefix) NULL, - MEMBER(lock_suffix) NULL, - MEMBER(timeout) 0, - MEMBER(stale_timeout) MAILDIR_UIDLIST_LOCK_STALE_TIMEOUT, - MEMBER(use_excl_lock) FALSE, - MEMBER(nfs_flush) FALSE, - MEMBER(use_io_notify) TRUE + .stale_timeout = MAILDIR_UIDLIST_LOCK_STALE_TIMEOUT, + .use_io_notify = TRUE }; static struct ioloop *ioloop;