[dovecot-cvs] dovecot/src/imap namespace.c, 1.15, 1.15.2.1 namespace.h, 1.5.2.1, 1.5.2.2

tss at dovecot.org tss at dovecot.org
Fri Dec 15 23:47:45 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	namespace.c namespace.h 
Log Message:
Added namespace_find_prefix() function.



Index: namespace.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/namespace.c,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- namespace.c	6 Mar 2006 18:13:31 -0000	1.15
+++ namespace.c	15 Dec 2006 23:47:42 -0000	1.15.2.1
@@ -233,3 +233,16 @@
 {
 	return namespace_find_int(namespaces, mailbox, FALSE);
 }
+
+struct namespace *
+namespace_find_prefix(struct namespace *namespaces, const char *prefix)
+{
+        struct namespace *ns;
+	unsigned int len = strlen(prefix);
+
+	for (ns = namespaces; ns != NULL; ns = ns->next) {
+		if (ns->prefix_len == len && strcmp(ns->prefix, prefix) == 0)
+			return ns;
+	}
+	return NULL;
+}

Index: namespace.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/namespace.h,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -d -r1.5.2.1 -r1.5.2.2
--- namespace.h	15 Dec 2006 21:02:37 -0000	1.5.2.1
+++ namespace.h	15 Dec 2006 23:47:43 -0000	1.5.2.2
@@ -29,5 +29,7 @@
 namespace_find(struct namespace *namespaces, const char **mailbox);
 struct namespace *
 namespace_find_visible(struct namespace *namespaces, const char **mailbox);
+struct namespace *
+namespace_find_prefix(struct namespace *namespaces, const char *prefix);
 
 #endif



More information about the dovecot-cvs mailing list