Lines Matching refs:_ctx
42 void imapc_transaction_save_rollback(struct mail_save_context *_ctx);
63 int imapc_save_begin(struct mail_save_context *_ctx, struct istream *input)
65 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
76 mail_set_critical(_ctx->dest_mail,
87 _ctx->data.output = o_stream_create_fd_file(ctx->fd, 0, FALSE);
88 o_stream_cork(_ctx->data.output);
92 int imapc_save_continue(struct mail_save_context *_ctx)
94 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
99 if (index_storage_save_continue(_ctx, ctx->input, NULL) < 0) {
215 struct mail_save_context *_ctx = &ctx->ctx;
216 struct mail_save_data *mdata = &_ctx->data;
268 int imapc_save_finish(struct mail_save_context *_ctx)
270 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
271 struct mail_storage *storage = _ctx->transaction->box->storage;
276 if (o_stream_finish(_ctx->data.output) < 0) {
278 mail_set_critical(_ctx->dest_mail,
280 o_stream_get_error(_ctx->data.output));
291 o_stream_unref(&_ctx->data.output);
295 index_save_context_free(_ctx);
299 void imapc_save_cancel(struct mail_save_context *_ctx)
301 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
304 (void)imapc_save_finish(_ctx);
307 int imapc_transaction_save_commit_pre(struct mail_save_context *_ctx)
309 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
311 _ctx->transaction->changes;
317 last_seq = mail_index_view_get_messages_count(_ctx->transaction->view);
328 void imapc_transaction_save_commit_post(struct mail_save_context *_ctx,
331 imapc_transaction_save_rollback(_ctx);
334 void imapc_transaction_save_rollback(struct mail_save_context *_ctx)
336 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
342 imapc_save_cancel(_ctx);
401 int imapc_copy(struct mail_save_context *_ctx, struct mail *mail)
403 struct imapc_save_context *ctx = IMAPC_SAVECTX(_ctx);
404 struct mailbox_transaction_context *_t = _ctx->transaction;
422 index_save_context_free(_ctx);
425 return mail_storage_copy(_ctx, mail);