[dovecot-cvs] dovecot/src/lib-storage mail-namespace.c, 1.1, 1.2 mail-namespace.h, 1.1, 1.2 mailbox-list-private.h, 1.4, 1.5 mailbox-list.c, 1.14, 1.15 mailbox-list.h, 1.7, 1.8

tss at dovecot.org tss at dovecot.org
Wed Apr 11 13:55:37 EEST 2007


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

Modified Files:
	mail-namespace.c mail-namespace.h mailbox-list-private.h 
	mailbox-list.c mailbox-list.h 
Log Message:
Added mailbox_list to struct mail_namespace. Added a few functions to get
private data out of mailbox_list.



Index: mail-namespace.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-namespace.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mail-namespace.c	3 Apr 2007 08:34:29 -0000	1.1
+++ mail-namespace.c	11 Apr 2007 10:55:34 -0000	1.2
@@ -9,8 +9,9 @@
 
 static void namespace_init_storage(struct mail_namespace *ns)
 {
+	ns->list = mail_storage_get_list(ns->storage);
 	ns->prefix_len = strlen(ns->prefix);
-	ns->real_sep = mail_storage_get_hierarchy_sep(ns->storage);
+	ns->real_sep = mailbox_list_get_hierarchy_sep(ns->list);
 
 	if (ns->sep == '\0')
                 ns->sep = ns->real_sep;

Index: mail-namespace.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-namespace.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mail-namespace.h	3 Apr 2007 08:34:29 -0000	1.1
+++ mail-namespace.h	11 Apr 2007 10:55:34 -0000	1.2
@@ -17,6 +17,8 @@
 	size_t prefix_len;
 
 	bool inbox, hidden, subscriptions;
+	struct mailbox_list *list;
+	/* FIXME: we should support multiple storages in one namespace */
 	struct mail_storage *storage;
 };
 

Index: mailbox-list-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mailbox-list-private.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mailbox-list-private.h	29 Mar 2007 11:51:22 -0000	1.4
+++ mailbox-list-private.h	11 Apr 2007 10:55:34 -0000	1.5
@@ -69,6 +69,7 @@
 
 /* private: */
 	pool_t pool;
+	struct mail_namespace *ns;
 	struct mailbox_list_settings set;
 	enum mailbox_list_flags flags;
 

Index: mailbox-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mailbox-list.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mailbox-list.c	31 Mar 2007 14:06:13 -0000	1.14
+++ mailbox-list.c	11 Apr 2007 10:55:34 -0000	1.15
@@ -74,7 +74,7 @@
 		array_free(&mailbox_list_drivers);
 }
 
-int mailbox_list_init(const char *driver,
+int mailbox_list_init(struct mail_namespace *ns, const char *driver,
 		      const struct mailbox_list_settings *set,
 		      enum mailbox_list_flags flags,
 		      struct mailbox_list **list_r, const char **error_r)
@@ -95,6 +95,7 @@
 	class_p = array_idx(&mailbox_list_drivers, idx);
 	list = (*class_p)->v.alloc();
 
+	list->ns = ns;
 	list->flags = flags;
 
 	/* copy settings */
@@ -164,6 +165,16 @@
 	return list->hierarchy_sep;
 }
 
+enum mailbox_list_flags mailbox_list_get_flags(struct mailbox_list *list)
+{
+	return list->flags;
+}
+
+struct mail_namespace *mailbox_list_get_namespace(struct mailbox_list *list)
+{
+	return list->ns;
+}
+
 bool mailbox_list_is_valid_mask(struct mailbox_list *list, const char *mask)
 {
 	return list->v.is_valid_mask(list, mask);

Index: mailbox-list.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mailbox-list.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mailbox-list.h	29 Mar 2007 07:59:15 -0000	1.7
+++ mailbox-list.h	11 Apr 2007 10:55:34 -0000	1.8
@@ -1,6 +1,7 @@
 #ifndef __MAILBOX_LIST_H
 #define __MAILBOX_LIST_H
 
+struct mail_namespace;
 struct mailbox_list;
 struct mailbox_list_iterate_context;
 
@@ -99,7 +100,7 @@
 void mailbox_list_unregister(const struct mailbox_list *list);
 
 /* Returns 0 if ok, -1 if initialization failed. */
-int mailbox_list_init(const char *driver,
+int mailbox_list_init(struct mail_namespace *ns, const char *driver,
 		      const struct mailbox_list_settings *set,
 		      enum mailbox_list_flags flags,
 		      struct mailbox_list **list_r, const char **error_r);
@@ -107,6 +108,8 @@
 
 const char *mailbox_list_get_driver_name(struct mailbox_list *list);
 char mailbox_list_get_hierarchy_sep(struct mailbox_list *list);
+enum mailbox_list_flags mailbox_list_get_flags(struct mailbox_list *list);
+struct mail_namespace *mailbox_list_get_namespace(struct mailbox_list *list);
 
 /* Returns TRUE if the name doesn't contain any invalid characters.
    The create name check can be more strict. */



More information about the dovecot-cvs mailing list