[dovecot-cvs] dovecot/src/plugins/quota quota-maildir.c,1.15,1.16

tss at dovecot.org tss at dovecot.org
Thu Nov 16 00:17:22 UTC 2006


Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv25364/src/plugins/quota

Modified Files:
	quota-maildir.c 
Log Message:
Initial code for separation of mailbox accessing and directory layout
handling. It's not yet possible to change the default layouts though.



Index: quota-maildir.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-maildir.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- quota-maildir.c	12 Nov 2006 20:04:56 -0000	1.15
+++ quota-maildir.c	16 Nov 2006 00:17:18 -0000	1.16
@@ -36,8 +36,9 @@
 };
 
 struct maildir_list_context {
-	struct mailbox_list_context *ctx;
-	struct mailbox_list *list;
+	struct mail_storage *storage;
+	struct mailbox_list_iterate_context *iter;
+	struct mailbox_info *info;
 
 	string_t *path;
 	int state;
@@ -131,10 +132,11 @@
 	struct maildir_list_context *ctx;
 
 	ctx = i_new(struct maildir_list_context, 1);
+	ctx->storage = storage;
 	ctx->path = str_new(default_pool, 512);
-	ctx->ctx = mail_storage_mailbox_list_init(storage, "", "*",
-						  MAILBOX_LIST_FAST_FLAGS |
-						  MAILBOX_LIST_INBOX);
+	ctx->iter = mailbox_list_iter_init(mail_storage_get_list(storage),
+					   "", "*",
+					   MAILBOX_LIST_ITER_FAST_FLAGS);
 	return ctx;
 }
 
@@ -147,14 +149,14 @@
 
 	for (;;) {
 		if (ctx->state == 0) {
-			ctx->list = mail_storage_mailbox_list_next(ctx->ctx);
-			if (ctx->list == NULL)
+			ctx->info = mailbox_list_iter_next(ctx->iter);
+			if (ctx->info == NULL)
 				return NULL;
 		}
 
 		t_push();
-		path = mail_storage_get_mailbox_path(ctx->ctx->storage,
-						     ctx->list->name,
+		path = mail_storage_get_mailbox_path(ctx->storage,
+						     ctx->info->name,
 						     &is_file);
 		str_truncate(ctx->path, 0);
 		str_append(ctx->path, path);
@@ -180,7 +182,7 @@
 
 static int maildir_list_deinit(struct maildir_list_context *ctx)
 {
-	int ret = mail_storage_mailbox_list_deinit(&ctx->ctx);
+	int ret = mailbox_list_iter_deinit(&ctx->iter);
 
 	str_free(&ctx->path);
 	i_free(ctx);



More information about the dovecot-cvs mailing list