changeset 4606:baaf62ced3d0 HEAD

Added mail_storage_get_mailbox_index_dir().
author Timo Sirainen <tss@iki.fi>
date Sun, 17 Sep 2006 19:21:41 +0300
parents e6cb9f75b76a
children 71b3570946f8
files src/lib-storage/index/dbox/dbox-storage.c src/lib-storage/index/mbox/mbox-storage.c src/lib-storage/mail-storage-private.h src/lib-storage/mail-storage.h
diffstat 4 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-storage.c	Sat Sep 16 16:50:21 2006 +0300
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Sun Sep 17 19:21:41 2006 +0300
@@ -319,6 +319,15 @@
 	return dbox_get_path(istorage, name);
 }
 
+static const char *
+dbox_get_mailbox_index_dir(struct mail_storage *_storage, const char *name)
+{
+	struct dbox_storage *storage = (struct dbox_storage *)_storage;
+	struct index_storage *istorage = INDEX_STORAGE(storage);
+
+	return dbox_get_index_dir(istorage, name);
+}
+
 static struct mailbox *
 dbox_open(struct dbox_storage *storage, const char *name,
 	  enum mailbox_open_flags flags)
@@ -700,6 +709,7 @@
 		index_storage_set_callbacks,
 		dbox_get_mailbox_path,
 		dbox_get_mailbox_control_dir,
+		dbox_get_mailbox_index_dir,
 		dbox_mailbox_open,
 		dbox_mailbox_create,
 		dbox_mailbox_delete,
--- a/src/lib-storage/index/mbox/mbox-storage.c	Sat Sep 16 16:50:21 2006 +0300
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Sun Sep 17 19:21:41 2006 +0300
@@ -681,7 +681,7 @@
 }
 
 static const char *
-mbox_get_mailbox_control_dir(struct mail_storage *_storage, const char *name)
+mbox_get_mailbox_index_dir(struct mail_storage *_storage, const char *name)
 {
 	struct mbox_storage *storage = (struct mbox_storage *)_storage;
 	struct index_storage *istorage = INDEX_STORAGE(storage);
@@ -1107,7 +1107,8 @@
 		mbox_autodetect,
 		index_storage_set_callbacks,
 		mbox_get_mailbox_path,
-		mbox_get_mailbox_control_dir,
+		mbox_get_mailbox_index_dir,
+		mbox_get_mailbox_index_dir,
 		mbox_mailbox_open,
 		mbox_mailbox_create,
 		mbox_mailbox_delete,
--- a/src/lib-storage/mail-storage-private.h	Sat Sep 16 16:50:21 2006 +0300
+++ b/src/lib-storage/mail-storage-private.h	Sun Sep 17 19:21:41 2006 +0300
@@ -31,6 +31,8 @@
 					const char *name, bool *is_file_r);
 	const char *(*get_mailbox_control_dir)(struct mail_storage *storage,
 					       const char *name);
+	const char *(*get_mailbox_index_dir)(struct mail_storage *storage,
+					     const char *name);
 
 	struct mailbox *(*mailbox_open)(struct mail_storage *storage,
 					const char *name,
--- a/src/lib-storage/mail-storage.h	Sat Sep 16 16:50:21 2006 +0300
+++ b/src/lib-storage/mail-storage.h	Sun Sep 17 19:21:41 2006 +0300
@@ -311,6 +311,10 @@
    doesn't exist in filesystem. */
 const char *mail_storage_get_mailbox_control_dir(struct mail_storage *storage,
 						 const char *name);
+/* Returns path to the index directory of the mailbox, or NULL if using
+   in-memory indexes or mailbox doesn't exist. */
+const char *mail_storage_get_mailbox_index_dir(struct mail_storage *storage,
+					       const char *name);
 
 /* Open a mailbox. If input stream is given, mailbox is opened read-only
    using it as a backend. If storage doesn't support stream backends and its