~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-storage/mail-namespace.h

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
struct mail_storage_callbacks;
7
7
 
8
 
enum namespace_type {
9
 
        NAMESPACE_PRIVATE       = 0x01,
10
 
        NAMESPACE_SHARED        = 0x02,
11
 
        NAMESPACE_PUBLIC        = 0x04
 
8
enum mail_namespace_type {
 
9
        MAIL_NAMESPACE_TYPE_PRIVATE     = 0x01,
 
10
        MAIL_NAMESPACE_TYPE_SHARED      = 0x02,
 
11
        MAIL_NAMESPACE_TYPE_PUBLIC      = 0x04
 
12
#define MAIL_NAMESPACE_TYPE_MASK_ALL \
 
13
        (MAIL_NAMESPACE_TYPE_PRIVATE | MAIL_NAMESPACE_TYPE_SHARED | \
 
14
         MAIL_NAMESPACE_TYPE_PUBLIC)
12
15
};
13
16
 
14
17
enum namespace_flags {
46
49
        struct mail_namespace *next;
47
50
        int refcount;
48
51
 
49
 
        enum namespace_type type;
 
52
        enum mail_namespace_type type;
50
53
        enum namespace_flags flags;
51
54
 
52
55
        char *prefix;
64
67
 
65
68
        struct mail_user *user, *owner;
66
69
        struct mailbox_list *list;
67
 
        /* FIXME: we should support multiple storages in one namespace */
68
 
        struct mail_storage *storage;
 
70
        struct mail_storage *storage; /* default storage */
 
71
        ARRAY(struct mail_storage *) all_storages;
69
72
 
70
 
        struct mail_namespace_settings *set, *unexpanded_set;
 
73
        const struct mail_namespace_settings *set, *unexpanded_set;
71
74
        const struct mail_storage_settings *mail_set;
72
75
 
 
76
        unsigned int special_use_mailboxes:1;
73
77
        unsigned int destroyed:1;
74
78
};
75
79
 
76
80
int mail_namespaces_init(struct mail_user *user, const char **error_r);
77
81
int mail_namespaces_init_location(struct mail_user *user, const char *location,
78
 
                                  const char **error_r);
 
82
                                  const char **error_r) ATTR_NULL(2);
79
83
struct mail_namespace *mail_namespaces_init_empty(struct mail_user *user);
80
84
/* Deinitialize all namespaces. mail_user_deinit() calls this automatically
81
85
   for user's namespaces. */
105
109
char mail_namespaces_get_root_sep(struct mail_namespace *namespaces)
106
110
        ATTR_PURE;
107
111
 
108
 
/* Returns namespace based on the mailbox name's prefix, or NULL if no matching
109
 
   namespace could be found. */
 
112
/* Returns namespace based on the mailbox name's prefix. Note that there is
 
113
   always a prefix="" namespace, so for this function NULL is never returned. */
110
114
struct mail_namespace *
111
115
mail_namespace_find(struct mail_namespace *namespaces, const char *mailbox);
112
 
/* Find namespace for mailbox and return it. If the namespace has alias_for
113
 
   set, return that namespace instead and change mailbox name to be a valid
 
116
/* Same as mail_namespace_find(), but if the namespace has alias_for set,
 
117
   return that namespace instead and change mailbox name to be a valid
114
118
   inside it. */
115
119
struct mail_namespace *
116
120
mail_namespace_find_unalias(struct mail_namespace *namespaces,
117
121
                            const char **mailbox);
118
 
/* Like above, but ignore hidden namespaces. */
 
122
 
 
123
/* Like mail_namespace_find(), but ignore hidden namespaces. */
119
124
struct mail_namespace *
120
125
mail_namespace_find_visible(struct mail_namespace *namespaces,
121
126
                            const char *mailbox);
122
 
/* Like above, but find only from namespaces with subscriptions flag set. */
 
127
/* Like mail_namespace_find(), but find only from namespaces with
 
128
   subscriptions=yes. */
123
129
struct mail_namespace *
124
130
mail_namespace_find_subscribable(struct mail_namespace *namespaces,
125
131
                                 const char *mailbox);
126
 
/* Like above, but find only from namespaces with subscriptions flag not set. */
 
132
/* Like mail_namespace_find(), but find only from namespaces with
 
133
   subscriptions=no. */
127
134
struct mail_namespace *
128
135
mail_namespace_find_unsubscribable(struct mail_namespace *namespaces,
129
136
                                   const char *mailbox);
130
 
/* Returns the INBOX namespace */
 
137
/* Returns the INBOX namespace, or NULL if there is no such  */
131
138
struct mail_namespace *
132
139
mail_namespace_find_inbox(struct mail_namespace *namespaces);
133
140
/* Find a namespace with given prefix. */