~james-page/ubuntu/raring/dovecot/autopkgtest

« back to all changes in this revision

Viewing changes to src/lib-storage/index/index-storage.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        MAILBOX_LOCK_NOTIFY_MAILBOX_OVERRIDE
17
17
};
18
18
 
19
 
struct index_transaction_context {
20
 
        struct mailbox_transaction_context mailbox_ctx;
21
 
        union mail_index_transaction_module_context module_ctx;
22
 
 
23
 
        struct mail_index_transaction_vfuncs super;
24
 
        int mail_ref_count;
25
 
 
26
 
        struct mail_cache_view *cache_view;
27
 
        struct mail_cache_transaction_ctx *cache_trans;
28
 
};
29
 
 
30
19
struct index_vsize_header {
31
20
        uint64_t vsize;
32
21
        uint32_t highest_uid;
37
26
        union mailbox_module_context module_ctx;
38
27
        enum mail_index_open_flags index_flags;
39
28
 
40
 
        int (*save_commit_pre)(struct mail_save_context *save_ctx);
41
 
        void (*save_commit_post)(struct mail_save_context *save_ctx,
42
 
                                 struct mail_index_transaction_commit_result *result_r);
43
 
        void (*save_rollback)(struct mail_save_context *save_ctx);
44
 
 
45
29
        struct timeout *notify_to, *notify_delay_to;
46
30
        struct index_notify_file *notify_files;
47
31
        struct index_notify_io *notify_ios;
48
 
        time_t notify_last_check;
49
32
 
50
33
        time_t next_lock_notify; /* temporary */
51
34
        enum mailbox_lock_notify_type last_notify_type;
59
42
        uint32_t vsize_hdr_ext_id;
60
43
 
61
44
        time_t sync_last_check;
 
45
        uint32_t list_index_sync_ext_id;
62
46
};
63
47
 
64
48
#define INDEX_STORAGE_CONTEXT(obj) \
71
55
                               unsigned int secs_left);
72
56
void index_storage_lock_notify_reset(struct mailbox *box);
73
57
 
74
 
void index_storage_mailbox_alloc(struct mailbox *box, const char *name,
 
58
int index_storage_mailbox_alloc_index(struct mailbox *box);
 
59
void index_storage_mailbox_alloc(struct mailbox *box, const char *vname,
75
60
                                 enum mailbox_flags flags,
76
61
                                 const char *index_prefix);
 
62
int index_storage_mailbox_exists(struct mailbox *box, bool auto_boxes,
 
63
                                 enum mailbox_existence *existence_r);
 
64
int index_storage_mailbox_exists_full(struct mailbox *box, const char *subdir,
 
65
                                      enum mailbox_existence *existence_r);
77
66
int index_storage_mailbox_open(struct mailbox *box, bool move_to_memory);
78
67
int index_storage_mailbox_enable(struct mailbox *box,
79
68
                                 enum mailbox_feature feature);
81
70
void index_storage_mailbox_free(struct mailbox *box);
82
71
int index_storage_mailbox_update(struct mailbox *box,
83
72
                                 const struct mailbox_update *update);
84
 
void index_storage_mailbox_update_cache_fields(struct mailbox *box,
85
 
                                               const struct mailbox_update *update);
 
73
void index_storage_mailbox_update_cache(struct mailbox *box,
 
74
                                        const struct mailbox_update *update);
86
75
int index_storage_mailbox_delete(struct mailbox *box);
87
76
int index_storage_mailbox_delete_dir(struct mailbox *box, bool mailbox_deleted);
88
77
int index_storage_mailbox_rename(struct mailbox *src, struct mailbox *dest,
89
78
                                 bool rename_children);
90
79
 
91
80
bool index_storage_is_readonly(struct mailbox *box);
92
 
bool index_storage_allow_new_keywords(struct mailbox *box);
93
81
bool index_storage_is_inconsistent(struct mailbox *box);
94
82
 
95
 
int index_keywords_create(struct mailbox *box, const char *const keywords[],
96
 
                          struct mail_keywords **keywords_r, bool skip_invalid);
97
 
struct mail_keywords *
98
 
index_keywords_create_from_indexes(struct mailbox *box,
99
 
                                   const ARRAY_TYPE(keyword_indexes) *idx);
100
 
void index_keywords_ref(struct mail_keywords *keywords);
101
 
void index_keywords_unref(struct mail_keywords *keywords);
102
 
bool index_keyword_is_valid(struct mailbox *box, const char *keyword,
103
 
                            const char **error_r);
104
 
 
105
83
void index_mailbox_set_recent_uid(struct mailbox *box, uint32_t uid);
106
84
void index_mailbox_set_recent_seq(struct mailbox *box,
107
85
                                  struct mail_index_view *view,
126
104
 
127
105
int index_storage_sync(struct mailbox *box, enum mailbox_sync_flags flags);
128
106
enum mailbox_sync_type index_sync_type_convert(enum mail_index_sync_type type);
129
 
void index_storage_get_status(struct mailbox *box,
130
 
                              enum mailbox_status_items items,
131
 
                              struct mailbox_status *status_r);
132
 
void index_storage_get_seq_range(struct mailbox *box,
133
 
                                 uint32_t uid1, uint32_t uid2,
134
 
                                 uint32_t *seq1_r, uint32_t *seq2_r);
135
 
void index_storage_get_uid_range(struct mailbox *box,
136
 
                                 const ARRAY_TYPE(seq_range) *seqs,
137
 
                                 ARRAY_TYPE(seq_range) *uids);
138
 
bool index_storage_get_expunges(struct mailbox *box, uint64_t prev_modseq,
139
 
                                const ARRAY_TYPE(seq_range) *uids_filter,
140
 
                                ARRAY_TYPE(seq_range) *expunged_uids,
141
 
                                ARRAY_TYPE(mailbox_expunge_rec) *expunges);
142
 
 
143
 
struct mailbox_header_lookup_ctx *
144
 
index_header_lookup_init(struct mailbox *box, const char *const headers[]);
145
 
void index_header_lookup_deinit(struct mailbox_header_lookup_ctx *ctx);
 
107
void index_sync_update_recent_count(struct mailbox *box);
 
108
int index_storage_get_status(struct mailbox *box,
 
109
                             enum mailbox_status_items items,
 
110
                             struct mailbox_status *status_r);
 
111
int index_mailbox_get_metadata(struct mailbox *box,
 
112
                               enum mailbox_metadata_items items,
 
113
                               struct mailbox_metadata *metadata_r);
146
114
 
147
115
struct mail_search_context *
148
116
index_storage_search_init(struct mailbox_transaction_context *t,
149
117
                          struct mail_search_args *args,
150
 
                          const enum mail_sort_type *sort_program);
 
118
                          const enum mail_sort_type *sort_program,
 
119
                          enum mail_fetch_field wanted_fields,
 
120
                          struct mailbox_header_lookup_ctx *wanted_headers);
151
121
int index_storage_search_deinit(struct mail_search_context *ctx);
152
122
bool index_storage_search_next_nonblock(struct mail_search_context *ctx,
153
 
                                        struct mail *mail, bool *tryagain_r);
 
123
                                        struct mail **mail_r, bool *tryagain_r);
154
124
bool index_storage_search_next_update_seq(struct mail_search_context *ctx);
155
125
 
156
 
void index_transaction_set_max_modseq(struct mailbox_transaction_context *_t,
157
 
                                      uint64_t max_modseq,
158
 
                                      ARRAY_TYPE(seq_range) *seqs);
159
 
 
160
126
struct mailbox_transaction_context *
161
127
index_transaction_begin(struct mailbox *box,
162
128
                        enum mailbox_transaction_flags flags);
163
 
void index_transaction_init(struct index_transaction_context *it,
 
129
void index_transaction_init(struct mailbox_transaction_context *t,
164
130
                            struct mailbox *box,
165
131
                            enum mailbox_transaction_flags flags);
166
132
int index_transaction_commit(struct mailbox_transaction_context *t,
169
135
void index_save_context_free(struct mail_save_context *ctx);
170
136
void index_copy_cache_fields(struct mail_save_context *ctx,
171
137
                             struct mail *src_mail, uint32_t dest_seq);
 
138
int index_storage_set_subscribed(struct mailbox *box, bool set);
172
139
 
173
140
bool index_keyword_array_cmp(const ARRAY_TYPE(keyword_indexes) *k1,
174
141
                             const ARRAY_TYPE(keyword_indexes) *k2);
175
142
 
 
143
int index_storage_list_index_has_changed(struct mailbox *box,
 
144
                                         struct mail_index_view *list_view,
 
145
                                         uint32_t seq);
 
146
void index_storage_list_index_update_sync(struct mailbox *box,
 
147
                                          struct mail_index_transaction *trans,
 
148
                                          uint32_t seq);
 
149
 
176
150
#endif