changeset 4796:49c9e7588de4 HEAD

s/quota/quota_set/ so we don't conflict with the quota symbol already present in Mac OS X.
author Timo Sirainen <tss@iki.fi>
date Sun, 12 Nov 2006 20:48:32 +0200
parents 23f63cd499ee
children 5f42c304d99f
files src/plugins/imap-quota/imap-quota-plugin.c src/plugins/quota/quota-plugin.c src/plugins/quota/quota-plugin.h src/plugins/quota/quota-storage.c src/plugins/trash/trash-plugin.c
diffstat 5 files changed, 24 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/imap-quota/imap-quota-plugin.c	Sun Nov 12 20:02:15 2006 +0200
+++ b/src/plugins/imap-quota/imap-quota-plugin.c	Sun Nov 12 20:48:32 2006 +0200
@@ -72,7 +72,7 @@
 		return TRUE;
 	}
 
-	if (quota == NULL) {
+	if (quota_set == NULL) {
 		mailbox_close(&box);
 		client_send_tagline(cmd, "OK No quota.");
 		return TRUE;
@@ -83,7 +83,7 @@
 	str_append(str, "* QUOTAROOT ");
 	imap_quote_append_string(str, mailbox, FALSE);
 
-	iter = quota_root_iter_init(quota, box);
+	iter = quota_root_iter_init(quota_set, box);
 	while ((root = quota_root_iter_next(iter)) != NULL) {
 		str_append_c(str, ' ');
 		imap_quote_append_string(str, quota_root_get_name(root), FALSE);
@@ -92,7 +92,7 @@
 	client_send_line(cmd->client, str_c(str));
 
 	/* send QUOTA reply for each quotaroot */
-	iter = quota_root_iter_init(quota, box);
+	iter = quota_root_iter_init(quota_set, box);
 	while ((root = quota_root_iter_next(iter)) != NULL)
 		quota_send(cmd, root);
 	quota_root_iter_deinit(iter);
@@ -112,12 +112,12 @@
 	if (!client_read_string_args(cmd, 1, &root_name))
 		return FALSE;
 
-	if (quota == NULL) {
+	if (quota_set == NULL) {
 		client_send_tagline(cmd, "OK No quota.");
 		return TRUE;
 	}
 
-	root = quota_root_lookup(quota, root_name);
+	root = quota_root_lookup(quota_set, root_name);
 	if (root == NULL) {
 		client_send_tagline(cmd, "NO Quota root doesn't exist.");
 		return TRUE;
@@ -145,12 +145,12 @@
 		return TRUE;
 	}
 
-	if (quota == NULL) {
+	if (quota_set == NULL) {
 		client_send_tagline(cmd, "OK No quota.");
 		return TRUE;
 	}
 
-	root = quota_root_lookup(quota, root_name);
+	root = quota_root_lookup(quota_set, root_name);
 	if (root == NULL) {
 		client_send_tagline(cmd, "NO Quota root doesn't exist.");
 		return TRUE;
--- a/src/plugins/quota/quota-plugin.c	Sun Nov 12 20:02:15 2006 +0200
+++ b/src/plugins/quota/quota-plugin.c	Sun Nov 12 20:48:32 2006 +0200
@@ -12,7 +12,7 @@
 
 void (*quota_next_hook_mail_storage_created)(struct mail_storage *storage);
 
-struct quota *quota;
+struct quota *quota_set;
 
 static void quota_root_add_rules(const char *root_name, 
 				 struct quota_root *root)
@@ -49,9 +49,9 @@
 	if (env == NULL)
 		return;
 
-	quota = quota_init();
+	quota_set = quota_init();
 
-	root = quota_root_init(quota, env);
+	root = quota_root_init(quota_set, env);
 	if (root == NULL)
 		i_fatal("Couldn't create quota root: %s", env);
 	quota_root_add_rules("QUOTA", root);
@@ -66,7 +66,7 @@
 		if (env == NULL)
 			break;
 
-		root = quota_root_init(quota, env);
+		root = quota_root_init(quota_set, env);
 		if (root == NULL)
 			i_fatal("Couldn't create quota root: %s", env);
 		quota_root_add_rules(root_name, root);
@@ -80,9 +80,9 @@
 
 void quota_plugin_deinit(void)
 {
-	if (quota != NULL) {
+	if (quota_set != NULL) {
 		hook_mail_storage_created =
 			quota_next_hook_mail_storage_created;
-		quota_deinit(quota);
+		quota_deinit(quota_set);
 	}
 }
--- a/src/plugins/quota/quota-plugin.h	Sun Nov 12 20:02:15 2006 +0200
+++ b/src/plugins/quota/quota-plugin.h	Sun Nov 12 20:48:32 2006 +0200
@@ -5,7 +5,9 @@
 
 extern void (*quota_next_hook_mail_storage_created)
 	(struct mail_storage *storage);
-extern struct quota *quota;
+/* "quota" symbol already exists in OSX, so we'll use this slightly uglier
+   name. */
+extern struct quota *quota_set;
 
 void quota_mail_storage_created(struct mail_storage *storage);
 
--- a/src/plugins/quota/quota-storage.c	Sun Nov 12 20:02:15 2006 +0200
+++ b/src/plugins/quota/quota-storage.c	Sun Nov 12 20:48:32 2006 +0200
@@ -54,7 +54,7 @@
 	struct quota_transaction_context *qt;
 
 	t = qbox->super.transaction_begin(box, flags);
-	qt = quota_transaction_begin(quota, box);
+	qt = quota_transaction_begin(quota_set, box);
 
 	array_idx_set(&t->module_contexts, quota_storage_module_id, &qt);
 	return t;
@@ -294,7 +294,7 @@
 {
 	struct quota_mail_storage *qstorage = QUOTA_CONTEXT(storage);
 
-	quota_remove_user_storage(quota, storage);
+	quota_remove_user_storage(quota_set, storage);
 
 	qstorage->super.destroy(storage);
 }
@@ -322,6 +322,6 @@
 
 	if ((storage->flags & MAIL_STORAGE_FLAG_SHARED_NAMESPACE) == 0) {
 		/* register to user's quota roots */
-		quota_add_user_storage(quota, storage);
+		quota_add_user_storage(quota_set, storage);
 	}
 }
--- a/src/plugins/trash/trash-plugin.c	Sun Nov 12 20:02:15 2006 +0200
+++ b/src/plugins/trash/trash-plugin.c	Sun Nov 12 20:48:32 2006 +0200
@@ -103,7 +103,7 @@
 			   we get proper namespace support for lib-storage. */
 			struct mail_storage *const *storage;
 
-			storage = array_idx(&quota->storages, 0);
+			storage = array_idx(&quota_set->storages, 0);
 			trashes[i].storage = *storage;
 		}
 		/* expunge oldest mails first in all trash boxes with
@@ -246,7 +246,7 @@
 	if (env == NULL)
 		return;
 
-	if (quota == NULL) {
+	if (quota_set == NULL) {
 		i_error("trash plugin: quota plugin not initialized");
 		return;
 	}
@@ -255,13 +255,13 @@
 	if (read_configuration(env) < 0)
 		return;
 
-	trash_next_quota_test_alloc = quota->test_alloc;
-	quota->test_alloc = trash_quota_test_alloc;
+	trash_next_quota_test_alloc = quota_set->test_alloc;
+	quota_set->test_alloc = trash_quota_test_alloc;
 }
 
 void trash_plugin_deinit(void)
 {
-	quota->test_alloc = trash_next_quota_test_alloc;
+	quota_set->test_alloc = trash_next_quota_test_alloc;
 
 	if (config_pool != NULL)
 		pool_unref(config_pool);