[dovecot-cvs] dovecot/src/imap namespace.c, 1.18, 1.19 namespace.h, 1.6, 1.7
tss at dovecot.org
tss at dovecot.org
Fri Dec 15 23:50:48 UTC 2006
Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv10904
Modified Files:
namespace.c namespace.h
Log Message:
Added namespace_find_prefix().
Index: namespace.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/namespace.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- namespace.c 6 Dec 2006 15:08:35 -0000 1.18
+++ namespace.c 15 Dec 2006 23:50:45 -0000 1.19
@@ -235,3 +235,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.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- namespace.h 18 Nov 2006 13:41:38 -0000 1.6
+++ namespace.h 15 Dec 2006 23:50:45 -0000 1.7
@@ -16,7 +16,7 @@
const char *prefix;
size_t prefix_len;
- int inbox, hidden, subscriptions;
+ bool inbox, hidden, subscriptions;
struct mail_storage *storage;
};
@@ -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