[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.90, 1.91 index-storage.h, 1.105, 1.106

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


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv25364/src/lib-storage/index

Modified Files:
	index-storage.c index-storage.h 
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: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- index-storage.c	3 Nov 2006 09:03:05 -0000	1.90
+++ index-storage.c	16 Nov 2006 00:16:33 -0000	1.91
@@ -41,9 +41,11 @@
 static int index_storage_refcount = 0;
 
 void index_storage_init(struct index_storage *storage,
+			struct mailbox_list *list,
 			enum mail_storage_flags flags,
 			enum mail_storage_lock_method lock_method)
 {
+	storage->storage.list = list;
 	storage->storage.flags = flags;
 	storage->storage.lock_method = lock_method;
 
@@ -95,8 +97,11 @@
 	struct stat st, st2;
 	int destroy_count;
 
-	if (index_dir == NULL || stat(index_dir, &st) < 0)
+	if (*index_dir == '\0' || stat(index_dir, &st) < 0) {
+		if (*index_dir == '\0')
+			index_dir = NULL;
 		memset(&st, 0, sizeof(st));
+	}
 
 	/* compare index_dir inodes so we don't break even with symlinks.
 	   for in-memory indexes compare just mailbox paths */

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- index-storage.h	7 Aug 2006 12:42:38 -0000	1.105
+++ index-storage.h	16 Nov 2006 00:16:33 -0000	1.106
@@ -24,11 +24,6 @@
 struct index_storage {
 	struct mail_storage storage;
 
-	const char *dir; /* root directory */
-	const char *index_dir;
-	const char *inbox_path; /* INBOX location */
-        const char *temp_prefix; /* prefix for temporary files */
-
 	const char *user; /* name of user accessing the storage */
 
 	struct mail_storage_callbacks *callbacks;
@@ -113,6 +108,7 @@
 void index_storage_destroy_unrefed(void);
 
 void index_storage_init(struct index_storage *storage,
+			struct mailbox_list *list,
 			enum mail_storage_flags flags,
 			enum mail_storage_lock_method lock_method);
 void index_storage_deinit(struct index_storage *storage);



More information about the dovecot-cvs mailing list