maildir-copy.c revision 8153fdec343e40e2a78f5c12353e89b994b28f74
/* Copyright (C) 2002-2004 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "maildir-storage.h"
#include "index-mail.h"
#include "mail-copy.h"
#include <stdlib.h>
#include <unistd.h>
struct maildir_copy_context {
struct maildir_mailbox *mbox;
int hardlink;
};
struct hardlink_ctx {
const char *dest_path;
int found;
};
struct rollback {
const char *fname;
};
void *context)
{
return 0;
"Not enough disk space");
return -1;
}
return 1;
"link(%s, %s) failed: %m",
return -1;
}
return 1;
}
struct maildir_copy_context *ctx)
{
struct hardlink_ctx do_ctx;
enum mail_flags flags;
const char *const *keywords;
const char *dest_fname;
do_hardlink, &do_ctx) < 0)
return -1;
return 0;
return 1;
}
static struct maildir_copy_context *
{
struct maildir_copy_context *ctx;
return ctx;
}
{
return 0;
}
{
t_push();
t_pop();
}
}
{
struct maildir_transaction_context *t =
(struct maildir_transaction_context *)_t;
struct maildir_copy_context *ctx;
int ret;
// FIXME: handle dest_mail
t_push();
t_pop();
if (ret > 0)
return 0;
if (ret < 0)
return -1;
/* non-fatal hardlinking failure, try the slow way */
}
}