sdbox-save.c revision b8d314c6355009ad0b9e332b6acecdfac5cc8891
/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "fdatasync-path.h"
#include "hex-binary.h"
#include "hex-dec.h"
#include "str.h"
#include "istream.h"
#include "istream-crlf.h"
#include "ostream.h"
#include "write-full.h"
#include "index-mail.h"
#include "mail-copy.h"
#include "dbox-save.h"
#include "sdbox-storage.h"
#include "sdbox-file.h"
#include "sdbox-sync.h"
#include <stdlib.h>
struct sdbox_save_context {
struct dbox_save_context ctx;
struct sdbox_mailbox *mbox;
struct sdbox_sync_context *sync_ctx;
struct dbox_file_append_context *append_ctx;
};
struct dbox_file *
{
struct sdbox_save_context *ctx =
(struct sdbox_save_context *)t->save_ctx;
unsigned int count;
}
struct mail_save_context *
sdbox_save_alloc(struct mailbox_transaction_context *t)
{
struct sdbox_save_context *ctx =
(struct sdbox_save_context *)t->save_ctx;
/* use the existing allocated structure */
}
return t->save_ctx;
}
{
int ret;
if (ret <= 0) {
return -1;
}
if (ctx->first_saved_seq == 0)
}
{
struct dbox_message_header dbox_msg_hdr;
sizeof(dbox_msg_hdr),
file->file_header_size) < 0) {
return -1;
}
return 0;
}
{
return -1;
/* we can't change ctime, but we can add the date to cache */
}
} T_END;
}
{
int ret;
return ret;
}
{
(void)sdbox_save_finish(_ctx);
}
{
struct seq_range_iter iter;
unsigned int i, count, n = 0;
bool ret;
for (i = 0; i < count; i++) {
return -1;
}
return 0;
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
"unlink(%s) failed: %m",
}
}
dbox_file_unref(&files[i]);
}
}
{
const struct mail_index_header *hdr;
return 0;
return -1;
}
/* assign UIDs for new messages */
return -1;
}
return 0;
}
{
return;
}
result);
i_error("fdatasync_path(%s) failed: %m",
}
}
}
{
}
{
/* FIXME: use hard linking */
}