[dovecot-cvs] dovecot/src/master master-settings-defs.c, 1.6, 1.7 master-settings.c, 1.158, 1.159

tss at dovecot.org tss at dovecot.org
Sat Mar 31 07:40:48 EEST 2007


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv10269/master

Modified Files:
	master-settings-defs.c master-settings.c 
Log Message:
Added type checks to setting defines.



Index: master-settings-defs.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/master-settings-defs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- master-settings-defs.c	5 Feb 2007 11:27:11 -0000	1.6
+++ master-settings-defs.c	31 Mar 2007 04:40:43 -0000	1.7
@@ -1,116 +1,120 @@
 /* kludgy: this file is included from master-settings.c and from deliver */
 
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct settings, name) }
+#undef DEF_STR
+#undef DEF_INT
+#undef DEF_BOOL
+#define DEF_STR(name) DEF_STRUCT_STR(name, settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, settings)
 
 static struct setting_def setting_defs[] = {
 	/* common */
-	DEF(SET_STR, base_dir),
-	DEF(SET_STR, log_path),
-	DEF(SET_STR, info_log_path),
-	DEF(SET_STR, log_timestamp),
-	DEF(SET_STR, syslog_facility),
+	DEF_STR(base_dir),
+	DEF_STR(log_path),
+	DEF_STR(info_log_path),
+	DEF_STR(log_timestamp),
+	DEF_STR(syslog_facility),
 
 	/* general */
-	DEF(SET_STR, protocols),
-	DEF(SET_STR, listen),
-	DEF(SET_STR, ssl_listen),
+	DEF_STR(protocols),
+	DEF_STR(listen),
+	DEF_STR(ssl_listen),
 
-	DEF(SET_BOOL, ssl_disable),
-	DEF(SET_STR, ssl_ca_file),
-	DEF(SET_STR, ssl_cert_file),
-	DEF(SET_STR, ssl_key_file),
-	DEF(SET_STR, ssl_key_password),
-	DEF(SET_INT, ssl_parameters_regenerate),
-	DEF(SET_STR, ssl_cipher_list),
-	DEF(SET_BOOL, ssl_verify_client_cert),
-	DEF(SET_BOOL, disable_plaintext_auth),
-	DEF(SET_BOOL, verbose_ssl),
-	DEF(SET_BOOL, shutdown_clients),
-	DEF(SET_BOOL, nfs_check),
-	DEF(SET_BOOL, version_ignore),
+	DEF_BOOL(ssl_disable),
+	DEF_STR(ssl_ca_file),
+	DEF_STR(ssl_cert_file),
+	DEF_STR(ssl_key_file),
+	DEF_STR(ssl_key_password),
+	DEF_INT(ssl_parameters_regenerate),
+	DEF_STR(ssl_cipher_list),
+	DEF_BOOL(ssl_verify_client_cert),
+	DEF_BOOL(disable_plaintext_auth),
+	DEF_BOOL(verbose_ssl),
+	DEF_BOOL(shutdown_clients),
+	DEF_BOOL(nfs_check),
+	DEF_BOOL(version_ignore),
 
 	/* login */
-	DEF(SET_STR, login_dir),
-	DEF(SET_STR, login_executable),
-	DEF(SET_STR, login_user),
-	DEF(SET_STR, login_greeting),
-	DEF(SET_STR, login_log_format_elements),
-	DEF(SET_STR, login_log_format),
+	DEF_STR(login_dir),
+	DEF_STR(login_executable),
+	DEF_STR(login_user),
+	DEF_STR(login_greeting),
+	DEF_STR(login_log_format_elements),
+	DEF_STR(login_log_format),
 
-	DEF(SET_BOOL, login_process_per_connection),
-	DEF(SET_BOOL, login_chroot),
-	DEF(SET_BOOL, login_greeting_capability),
+	DEF_BOOL(login_process_per_connection),
+	DEF_BOOL(login_chroot),
+	DEF_BOOL(login_greeting_capability),
 
-	DEF(SET_INT, login_process_size),
-	DEF(SET_INT, login_processes_count),
-	DEF(SET_INT, login_max_processes_count),
-	DEF(SET_INT, login_max_connections),
+	DEF_INT(login_process_size),
+	DEF_INT(login_processes_count),
+	DEF_INT(login_max_processes_count),
+	DEF_INT(login_max_connections),
 
 	/* mail */
-	DEF(SET_STR, valid_chroot_dirs),
-	DEF(SET_STR, mail_chroot),
-	DEF(SET_INT, max_mail_processes),
-	DEF(SET_BOOL, verbose_proctitle),
+	DEF_STR(valid_chroot_dirs),
+	DEF_STR(mail_chroot),
+	DEF_INT(max_mail_processes),
+	DEF_BOOL(verbose_proctitle),
 
-	DEF(SET_INT, first_valid_uid),
-	DEF(SET_INT, last_valid_uid),
-	DEF(SET_INT, first_valid_gid),
-	DEF(SET_INT, last_valid_gid),
-	DEF(SET_STR, mail_extra_groups),
+	DEF_INT(first_valid_uid),
+	DEF_INT(last_valid_uid),
+	DEF_INT(first_valid_gid),
+	DEF_INT(last_valid_gid),
+	DEF_STR(mail_extra_groups),
 
-	DEF(SET_STR, default_mail_env),
-	DEF(SET_STR, mail_location),
-	DEF(SET_STR, mail_cache_fields),
-	DEF(SET_STR, mail_never_cache_fields),
-	DEF(SET_INT, mail_cache_min_mail_count),
-	DEF(SET_INT, mailbox_idle_check_interval),
-	DEF(SET_BOOL, mail_debug),
-	DEF(SET_BOOL, mail_full_filesystem_access),
-	DEF(SET_INT, mail_max_keyword_length),
-	DEF(SET_BOOL, mail_save_crlf),
-	DEF(SET_BOOL, mmap_disable),
-	DEF(SET_BOOL, mmap_no_write),
-	DEF(SET_BOOL, dotlock_use_excl),
-	DEF(SET_BOOL, fsync_disable),
-	DEF(SET_STR, lock_method),
-	DEF(SET_BOOL, maildir_stat_dirs),
-	DEF(SET_BOOL, maildir_copy_with_hardlinks),
-	DEF(SET_BOOL, maildir_copy_preserve_filename),
-	DEF(SET_STR, mbox_read_locks),
-	DEF(SET_STR, mbox_write_locks),
-	DEF(SET_INT, mbox_lock_timeout),
-	DEF(SET_INT, mbox_dotlock_change_timeout),
-	DEF(SET_INT, mbox_min_index_size),
-	DEF(SET_BOOL, mbox_dirty_syncs),
-	DEF(SET_BOOL, mbox_very_dirty_syncs),
-	DEF(SET_BOOL, mbox_lazy_writes),
-	DEF(SET_INT, dbox_rotate_size),
-	DEF(SET_INT, dbox_rotate_min_size),
-	DEF(SET_INT, dbox_rotate_days),
-	DEF(SET_INT, umask),
-	DEF(SET_BOOL, mail_drop_priv_before_exec),
+	DEF_STR(default_mail_env),
+	DEF_STR(mail_location),
+	DEF_STR(mail_cache_fields),
+	DEF_STR(mail_never_cache_fields),
+	DEF_INT(mail_cache_min_mail_count),
+	DEF_INT(mailbox_idle_check_interval),
+	DEF_BOOL(mail_debug),
+	DEF_BOOL(mail_full_filesystem_access),
+	DEF_INT(mail_max_keyword_length),
+	DEF_BOOL(mail_save_crlf),
+	DEF_BOOL(mmap_disable),
+	DEF_BOOL(mmap_no_write),
+	DEF_BOOL(dotlock_use_excl),
+	DEF_BOOL(fsync_disable),
+	DEF_STR(lock_method),
+	DEF_BOOL(maildir_stat_dirs),
+	DEF_BOOL(maildir_copy_with_hardlinks),
+	DEF_BOOL(maildir_copy_preserve_filename),
+	DEF_STR(mbox_read_locks),
+	DEF_STR(mbox_write_locks),
+	DEF_INT(mbox_lock_timeout),
+	DEF_INT(mbox_dotlock_change_timeout),
+	DEF_INT(mbox_min_index_size),
+	DEF_BOOL(mbox_dirty_syncs),
+	DEF_BOOL(mbox_very_dirty_syncs),
+	DEF_BOOL(mbox_lazy_writes),
+	DEF_INT(dbox_rotate_size),
+	DEF_INT(dbox_rotate_min_size),
+	DEF_INT(dbox_rotate_days),
+	DEF_INT(umask),
+	DEF_BOOL(mail_drop_priv_before_exec),
 
-	DEF(SET_STR, mail_executable),
-	DEF(SET_INT, mail_process_size),
-	DEF(SET_STR, mail_plugins),
-	DEF(SET_STR, mail_plugin_dir),
-	DEF(SET_STR, mail_log_prefix),
-	DEF(SET_INT, mail_log_max_lines_per_sec),
+	DEF_STR(mail_executable),
+	DEF_INT(mail_process_size),
+	DEF_STR(mail_plugins),
+	DEF_STR(mail_plugin_dir),
+	DEF_STR(mail_log_prefix),
+	DEF_INT(mail_log_max_lines_per_sec),
 
 	/* imap */
-	DEF(SET_INT, imap_max_line_length),
-	DEF(SET_STR, imap_capability),
-	DEF(SET_STR, imap_client_workarounds),
+	DEF_INT(imap_max_line_length),
+	DEF_STR(imap_capability),
+	DEF_STR(imap_client_workarounds),
 
 	/* pop3 */
-	DEF(SET_BOOL, pop3_no_flag_updates),
-	DEF(SET_BOOL, pop3_enable_last),
-	DEF(SET_BOOL, pop3_reuse_xuidl),
-	DEF(SET_BOOL, pop3_lock_session),
-	DEF(SET_STR, pop3_uidl_format),
-	DEF(SET_STR, pop3_client_workarounds),
-	DEF(SET_STR, pop3_logout_format),
+	DEF_BOOL(pop3_no_flag_updates),
+	DEF_BOOL(pop3_enable_last),
+	DEF_BOOL(pop3_reuse_xuidl),
+	DEF_BOOL(pop3_lock_session),
+	DEF_STR(pop3_uidl_format),
+	DEF_STR(pop3_client_workarounds),
+	DEF_STR(pop3_logout_format),
 
 	{ 0, NULL, 0 }
 };

Index: master-settings.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/master-settings.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- master-settings.c	27 Mar 2007 21:42:00 -0000	1.158
+++ master-settings.c	31 Mar 2007 04:40:43 -0000	1.159
@@ -51,99 +51,103 @@
 
 #include "master-settings-defs.c"
 
-#undef DEF
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct auth_settings, name) }
+#undef DEF_STR
+#undef DEF_INT
+#undef DEF_BOOL
+#define DEF_STR(name) DEF_STRUCT_STR(name, auth_settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, auth_settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, auth_settings)
 
 static struct setting_def auth_setting_defs[] = {
-	DEF(SET_STR, mechanisms),
-	DEF(SET_STR, realms),
-	DEF(SET_STR, default_realm),
-	DEF(SET_INT, cache_size),
-	DEF(SET_INT, cache_ttl),
-	DEF(SET_STR, executable),
-	DEF(SET_STR, user),
-	DEF(SET_STR, chroot),
-	DEF(SET_STR, username_chars),
-	DEF(SET_STR, username_translation),
-	DEF(SET_STR, username_format),
-	DEF(SET_STR, master_user_separator),
-	DEF(SET_STR, anonymous_username),
-	DEF(SET_STR, krb5_keytab),
-	DEF(SET_STR, gssapi_hostname),
+	DEF_STR(mechanisms),
+	DEF_STR(realms),
+	DEF_STR(default_realm),
+	DEF_INT(cache_size),
+	DEF_INT(cache_ttl),
+	DEF_STR(executable),
+	DEF_STR(user),
+	DEF_STR(chroot),
+	DEF_STR(username_chars),
+	DEF_STR(username_translation),
+	DEF_STR(username_format),
+	DEF_STR(master_user_separator),
+	DEF_STR(anonymous_username),
+	DEF_STR(krb5_keytab),
+	DEF_STR(gssapi_hostname),
 
-	DEF(SET_BOOL, verbose),
-	DEF(SET_BOOL, debug),
-	DEF(SET_BOOL, debug_passwords),
-	DEF(SET_BOOL, ssl_require_client_cert),
-	DEF(SET_BOOL, ssl_username_from_cert),
+	DEF_BOOL(verbose),
+	DEF_BOOL(debug),
+	DEF_BOOL(debug_passwords),
+	DEF_BOOL(ssl_require_client_cert),
+	DEF_BOOL(ssl_username_from_cert),
 
-	DEF(SET_INT, count),
-	DEF(SET_INT, worker_max_count),
-	DEF(SET_INT, process_size),
+	DEF_INT(count),
+	DEF_INT(worker_max_count),
+	DEF_INT(process_size),
 
 	{ 0, NULL, 0 }
 };
 
-#undef DEF
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct socket_settings, name) }
+#undef DEF_STR
+#undef DEF_INT
+#undef DEF_BOOL
+#define DEF_STR(name) DEF_STRUCT_STR(name, socket_settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, socket_settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, socket_settings)
 
 static struct setting_def socket_setting_defs[] = {
-	DEF(SET_STR, path),
-	DEF(SET_INT, mode),
-	DEF(SET_STR, user),
-	DEF(SET_STR, group),
+	DEF_STR(path),
+	DEF_INT(mode),
+	DEF_STR(user),
+	DEF_STR(group),
 
 	{ 0, NULL, 0 }
 };
 
-#undef DEF
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct auth_socket_settings, name) }
-
 static struct setting_def auth_socket_setting_defs[] = {
-	DEF(SET_STR, type),
+	DEF_STRUCT_STR(type, auth_socket_settings),
 
 	{ 0, NULL, 0 }
 };
 
-#undef DEF
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct auth_passdb_settings, name) }
+#undef DEF_STR
+#undef DEF_INT
+#undef DEF_BOOL
+#define DEF_STR(name) DEF_STRUCT_STR(name, auth_passdb_settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, auth_passdb_settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, auth_passdb_settings)
 
 static struct setting_def auth_passdb_setting_defs[] = {
-	DEF(SET_STR, driver),
-	DEF(SET_STR, args),
-	DEF(SET_BOOL, deny),
-	DEF(SET_BOOL, pass),
-	DEF(SET_BOOL, master),
+	DEF_STR(driver),
+	DEF_STR(args),
+	DEF_BOOL(deny),
+	DEF_BOOL(pass),
+	DEF_BOOL(master),
 
 	{ 0, NULL, 0 }
 };
 
-#undef DEF
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct auth_userdb_settings, name) }
-
 static struct setting_def auth_userdb_setting_defs[] = {
-	DEF(SET_STR, driver),
-	DEF(SET_STR, args),
+	DEF_STRUCT_STR(driver, auth_userdb_settings),
+	DEF_STRUCT_STR(args, auth_userdb_settings),
 
 	{ 0, NULL, 0 }
 };
 
-#undef DEF
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct namespace_settings, name) }
+#undef DEF_STR
+#undef DEF_INT
+#undef DEF_BOOL
+#define DEF_STR(name) DEF_STRUCT_STR(name, namespace_settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, namespace_settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, namespace_settings)
 
 static struct setting_def namespace_setting_defs[] = {
-	DEF(SET_STR, type),
-	DEF(SET_STR, separator),
-	DEF(SET_STR, prefix),
-	DEF(SET_STR, location),
-	DEF(SET_BOOL, inbox),
-	DEF(SET_BOOL, hidden),
+	DEF_STR(type),
+	DEF_STR(separator),
+	DEF_STR(prefix),
+	DEF_STR(location),
+	DEF_BOOL(inbox),
+	DEF_BOOL(hidden),
 
 	{ 0, NULL, 0 }
 };



More information about the dovecot-cvs mailing list