[dovecot-cvs] dovecot/src/imap Makefile.am, 1.39, 1.40 client.c, 1.82, 1.83 client.h, 1.42, 1.43 cmd-create.c, 1.15, 1.16 cmd-list.c, 1.67, 1.68 cmd-namespace.c, 1.5, 1.6 commands-util.c, 1.53, 1.54 commands-util.h, 1.27, 1.28 main.c, 1.89, 1.90 namespace.c, 1.20, NONE namespace.h, 1.7, NONE

tss at dovecot.org tss at dovecot.org
Tue Apr 3 11:34:32 EEST 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv21629/imap

Modified Files:
	Makefile.am client.c client.h cmd-create.c cmd-list.c 
	cmd-namespace.c commands-util.c commands-util.h main.c 
Removed Files:
	namespace.c namespace.h 
Log Message:
Moved namespace handling to lib-storage. Beginnings of namespace support for
non-IMAP parts of Dovecot.



Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/Makefile.am,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- Makefile.am	22 Feb 2007 21:50:48 -0000	1.39
+++ Makefile.am	3 Apr 2007 08:34:29 -0000	1.40
@@ -84,8 +84,7 @@
 	imap-sync.c \
 	imap-thread.c \
 	mail-storage-callbacks.c \
-	main.c \
-	namespace.c
+	main.c
 
 
 headers = \
@@ -99,8 +98,7 @@
 	imap-search.h \
 	imap-sort.h \
 	imap-sync.h \
-	imap-thread.h \
-	namespace.h
+	imap-thread.h
 
 if INSTALL_HEADERS
   pkginc_libdir=$(pkgincludedir)/src/imap

Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- client.c	25 Mar 2007 21:53:11 -0000	1.82
+++ client.c	3 Apr 2007 08:34:29 -0000	1.83
@@ -6,7 +6,7 @@
 #include "istream.h"
 #include "ostream.h"
 #include "commands.h"
-#include "namespace.h"
+#include "mail-namespace.h"
 
 #include <stdlib.h>
 #include <unistd.h>
@@ -17,7 +17,7 @@
 static struct timeout *to_idle;
 
 struct client *client_create(int fd_in, int fd_out,
-			     struct namespace *namespaces)
+			     struct mail_namespace *namespaces)
 {
 	struct client *client;
 
@@ -95,7 +95,7 @@
 
 	if (client->mailbox != NULL)
 		mailbox_close(&client->mailbox);
-	namespace_deinit(client->namespaces);
+	mail_namespaces_deinit(&client->namespaces);
 
 	if (client->free_parser != NULL)
 		imap_parser_destroy(&client->free_parser);

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- client.h	1 Mar 2007 10:18:02 -0000	1.42
+++ client.h	3 Apr 2007 08:34:29 -0000	1.43
@@ -43,7 +43,7 @@
 	struct istream *input;
 	struct ostream *output;
 
-        struct namespace *namespaces;
+        struct mail_namespace *namespaces;
 	struct mailbox *mailbox;
         struct mailbox_keywords keywords;
 	unsigned int select_counter; /* increased when mailbox is changed */
@@ -73,7 +73,7 @@
 /* Create new client with specified input/output handles. socket specifies
    if the handle is a socket. */
 struct client *client_create(int fd_in, int fd_out,
-			     struct namespace *namespaces);
+			     struct mail_namespace *namespaces);
 void client_destroy(struct client *client, const char *reason);
 
 /* Disconnect client connection */

Index: cmd-create.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-create.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmd-create.c	13 Mar 2007 17:18:39 -0000	1.15
+++ cmd-create.c	3 Apr 2007 08:34:29 -0000	1.16
@@ -1,12 +1,12 @@
 /* Copyright (C) 2002 Timo Sirainen */
 
 #include "common.h"
-#include "namespace.h"
+#include "mail-namespace.h"
 #include "commands.h"
 
 bool cmd_create(struct client_command_context *cmd)
 {
-	struct namespace *ns;
+	struct mail_namespace *ns;
 	const char *mailbox, *full_mailbox;
 	bool directory;
 	size_t len;

Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- cmd-list.c	27 Mar 2007 21:32:25 -0000	1.67
+++ cmd-list.c	3 Apr 2007 08:34:29 -0000	1.68
@@ -6,7 +6,7 @@
 #include "imap-quote.h"
 #include "imap-match.h"
 #include "commands.h"
-#include "namespace.h"
+#include "mail-namespace.h"
 
 enum {
 	_MAILBOX_LIST_ITER_HIDE_CHILDREN	= 0x1000000,
@@ -18,7 +18,7 @@
 	const char *mask;
 	enum mailbox_list_flags list_flags;
 
-	struct namespace *ns;
+	struct mail_namespace *ns;
 	struct mailbox_list_iterate_context *list_iter;
 	struct imap_match_glob *glob;
 
@@ -232,7 +232,7 @@
 		    struct cmd_list_context *ctx)
 {
         struct client *client = cmd->client;
-	struct namespace *ns = ctx->ns;
+	struct mail_namespace *ns = ctx->ns;
 	const char *cur_ns_prefix, *cur_ref, *cur_mask;
 	enum imap_match_result match;
 	enum imap_match_result inbox_match;
@@ -392,8 +392,8 @@
 		ctx->glob = NULL;
 	}
 
-	cur_ref = namespace_fix_sep(ns, cur_ref);
-	cur_mask = namespace_fix_sep(ns, cur_mask);
+	cur_ref = mail_namespace_fix_sep(ns, cur_ref);
+	cur_mask = mail_namespace_fix_sep(ns, cur_mask);
 
 	list_flags = ctx->list_flags;
 	if (ctx->match_inbox)
@@ -438,7 +438,7 @@
 bool _cmd_list_full(struct client_command_context *cmd, bool lsub)
 {
 	struct client *client = cmd->client;
-	struct namespace *ns;
+	struct mail_namespace *ns;
 	struct imap_arg *args;
 	enum mailbox_list_flags list_flags;
         struct cmd_list_context *ctx;
@@ -485,19 +485,20 @@
 		   concept which probably no other client uses than Pine.
 		   Just try our best to emulate UW-IMAP behavior and hopefully
 		   we're fine. */
-		ns = namespace_find_visible(client->namespaces, &ref);
+		ns = mail_namespace_find_visible(client->namespaces, &ref);
 		if (ns != NULL)
 			ns_prefix = ns->prefix;
 		else {
 			const char *empty = "";
 
 			ns_prefix = "";
-			ns = namespace_find(client->namespaces, &empty);
+			ns = mail_namespace_find(client->namespaces, &empty);
 			if (ns == NULL) {
 				/* we must reply something. use INBOX
 				   namespace's separator. */
 				const char *inbox = "INBOX";
-				ns = namespace_find(client->namespaces, &inbox);
+				ns = mail_namespace_find(client->namespaces,
+							 &inbox);
 			}
 		}
 

Index: cmd-namespace.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-namespace.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cmd-namespace.c	13 Jan 2006 20:25:59 -0000	1.5
+++ cmd-namespace.c	3 Apr 2007 08:34:29 -0000	1.6
@@ -4,10 +4,10 @@
 #include "str.h"
 #include "imap-quote.h"
 #include "commands.h"
-#include "namespace.h"
+#include "mail-namespace.h"
 
-static void list_namespaces(struct namespace *ns, enum namespace_type type,
-			    string_t *str)
+static void list_namespaces(struct mail_namespace *ns,
+			    enum namespace_type type, string_t *str)
 {
 	bool found = FALSE;
 

Index: commands-util.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands-util.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- commands-util.c	13 Mar 2007 17:17:09 -0000	1.53
+++ commands-util.c	3 Apr 2007 08:34:29 -0000	1.54
@@ -10,7 +10,7 @@
 #include "imap-parser.h"
 #include "imap-sync.h"
 #include "imap-util.h"
-#include "namespace.h"
+#include "mail-namespace.h"
 
 /* Maximum length for mailbox name, including it's path. This isn't fully
    exact since the user can create folder hierarchy with small names, then
@@ -18,12 +18,12 @@
    to them, mbox/maildir currently allow paths only up to PATH_MAX. */
 #define MAILBOX_MAX_NAME_LEN 512
 
-struct namespace *
+struct mail_namespace *
 client_find_namespace(struct client_command_context *cmd, const char **mailbox)
 {
-	struct namespace *ns;
+	struct mail_namespace *ns;
 
-	ns = namespace_find(cmd->client->namespaces, mailbox);
+	ns = mail_namespace_find(cmd->client->namespaces, mailbox);
 	if (ns != NULL)
 		return ns;
 
@@ -34,7 +34,7 @@
 struct mail_storage *
 client_find_storage(struct client_command_context *cmd, const char **mailbox)
 {
-	struct namespace *ns;
+	struct mail_namespace *ns;
 
 	ns = client_find_namespace(cmd, mailbox);
 	return ns == NULL ? NULL : ns->storage;
@@ -44,7 +44,7 @@
 				const char *mailbox,
 				bool should_exist, bool should_not_exist)
 {
-	struct namespace *ns;
+	struct mail_namespace *ns;
 	struct mailbox_list *list;
 	enum mailbox_name_status mailbox_status;
 	const char *orig_mailbox, *p;

Index: commands-util.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands-util.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- commands-util.h	13 Mar 2007 17:17:09 -0000	1.27
+++ commands-util.h	3 Apr 2007 08:34:29 -0000	1.28
@@ -11,7 +11,7 @@
 
 /* Finds namespace for given mailbox from namespaces. If not found,
    sends "Unknown namespace" error message to client. */
-struct namespace *
+struct mail_namespace *
 client_find_namespace(struct client_command_context *cmd, const char **mailbox);
 /* Finds mail storage for given mailbox from namespaces. If not found,
    sends "Unknown namespace" error message to client. */

Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- main.c	15 Mar 2007 15:53:04 -0000	1.89
+++ main.c	3 Apr 2007 08:34:29 -0000	1.90
@@ -14,7 +14,7 @@
 #include "dict-client.h"
 #include "mail-storage.h"
 #include "commands.h"
-#include "namespace.h"
+#include "mail-namespace.h"
 #include "imap-thread.h"
 
 #include <stdio.h>
@@ -163,6 +163,7 @@
 static void main_init(void)
 {
 	struct client *client;
+	struct mail_namespace *ns;
 	const char *user, *str;
 
 	lib_signals_init();
@@ -232,7 +233,9 @@
         parse_workarounds();
 
 	namespace_pool = pool_alloconly_create("namespaces", 1024);
-	client = client_create(0, 1, namespace_init(namespace_pool, user));
+	if (mail_namespaces_init(namespace_pool, user, &ns) < 0)
+		exit(FATAL_DEFAULT);
+	client = client_create(0, 1, ns);
 
         o_stream_cork(client->output);
 	if (IS_STANDALONE()) {

--- namespace.c DELETED ---

--- namespace.h DELETED ---



More information about the dovecot-cvs mailing list