[dovecot-cvs] dovecot/src/lib-storage/index index-expunge.c,1.18,1.19 index-storage.c,1.37,1.38 index-storage.h,1.45,1.46 index-update-flags.c,1.24,1.25

cras at procontrol.fi cras at procontrol.fi
Sat Jul 26 20:55:14 EEST 2003


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv13066/lib-storage/index

Modified Files:
	index-expunge.c index-storage.c index-storage.h 
	index-update-flags.c 
Log Message:
API changes: Don't keep variables in mailbox class.



Index: index-expunge.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-expunge.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- index-expunge.c	26 Jul 2003 16:33:22 -0000	1.18
+++ index-expunge.c	26 Jul 2003 16:55:11 -0000	1.19
@@ -53,7 +53,7 @@
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 	struct mail_expunge_context *ctx;
 
-	if (box->readonly) {
+	if (box->is_readonly(box)) {
 		box->storage->callbacks->
 			notify_no(box, "Mailbox is read-only, ignoring expunge",
 				  box->storage->callback_context);

Index: index-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- index-storage.c	26 Jul 2003 16:33:22 -0000	1.37
+++ index-storage.c	26 Jul 2003 16:55:11 -0000	1.38
@@ -271,7 +271,7 @@
 void index_storage_init_lock_notify(struct index_mailbox *ibox)
 {
 	if (ibox->index->mailbox_readonly)
-		ibox->box.readonly = TRUE;
+		ibox->readonly = TRUE;
 
 	ibox->next_lock_notify = time(NULL) + LOCK_NOTIFY_INTERVAL;
 	ibox->last_notify_type = (enum mail_lock_notify_type)-1;
@@ -328,7 +328,7 @@
 
 		ibox->box.storage = storage;
 		ibox->box.name = i_strdup(name);
-		ibox->box.readonly = (flags & MAILBOX_OPEN_READONLY) != 0;
+		ibox->readonly = (flags & MAILBOX_OPEN_READONLY) != 0;
 
 		ibox->index = index;
 
@@ -356,8 +356,6 @@
 		if (!ibox->index->set_lock(ibox->index, MAIL_LOCK_SHARED))
 			break;
 
-		ibox->box.allow_custom_flags =
-			ibox->index->allow_new_custom_flags;
 		ibox->synced_messages_count =
 			mail_index_get_header(index)->messages_count;
 
@@ -391,6 +389,27 @@
 	return TRUE;
 }
 
+int index_storage_is_readonly(struct mailbox *box)
+{
+	struct index_mailbox *ibox = (struct index_mailbox *) box;
+
+	return ibox->readonly;
+}
+
+int index_storage_allow_new_custom_flags(struct mailbox *box)
+{
+	struct index_mailbox *ibox = (struct index_mailbox *) box;
+
+	return ibox->index->allow_new_custom_flags;
+}
+
+int index_storage_is_inconsistency_error(struct mailbox *box)
+{
+	struct index_mailbox *ibox = (struct index_mailbox *) box;
+
+	return ibox->inconsistent;
+}
+
 void index_storage_set_callbacks(struct mail_storage *storage,
 				 struct mail_storage_callbacks *callbacks,
 				 void *context)
@@ -408,7 +427,7 @@
 		mail_storage_set_internal_error(ibox->box.storage);
 		break;
 	case MAIL_INDEX_ERROR_INCONSISTENT:
-		ibox->box.inconsistent = TRUE;
+		ibox->inconsistent = TRUE;
 		break;
 	case MAIL_INDEX_ERROR_DISKSPACE:
 		mail_storage_set_error(ibox->box.storage, "Out of disk space");

Index: index-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- index-storage.h	26 Jul 2003 16:33:22 -0000	1.45
+++ index-storage.h	26 Jul 2003 16:55:11 -0000	1.46
@@ -34,6 +34,8 @@
 	time_t next_lock_notify; /* temporary */
 	enum mail_lock_notify_type last_notify_type;
 
+	unsigned int readonly:1;
+	unsigned int inconsistent:1;
 	unsigned int sent_diskspace_warning:1;
 	unsigned int sent_readonly_flags_warning:1;
 };
@@ -56,6 +58,10 @@
 			   struct mail_index *index, const char *name,
 			   enum mailbox_open_flags flags);
 int index_storage_mailbox_free(struct mailbox *box);
+
+int index_storage_is_readonly(struct mailbox *box);
+int index_storage_allow_new_custom_flags(struct mailbox *box);
+int index_storage_is_inconsistency_error(struct mailbox *box);
 
 int index_storage_sync_and_lock(struct index_mailbox *ibox,
 				int sync_size, int minimal_sync,

Index: index-update-flags.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-update-flags.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- index-update-flags.c	26 Jul 2003 16:33:22 -0000	1.24
+++ index-update-flags.c	26 Jul 2003 16:55:11 -0000	1.25
@@ -14,7 +14,7 @@
 	struct mail_storage *storage = mail->box->storage;
 	enum mail_flags modify_flags, new_flags;
 
-	if (mail->box->readonly) {
+	if (mail->box->is_readonly(mail->box)) {
 		if (ibox->sent_readonly_flags_warning)
 			return TRUE;
                 ibox->sent_readonly_flags_warning = TRUE;



More information about the dovecot-cvs mailing list