mbox-expunge.c revision 1c64ce475b982a84d55ce3028721e4a123b05ef2
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "iobuffer.h"
#include "mbox-index.h"
#include "mbox-storage.h"
#include "mbox-lock.h"
#include <fcntl.h>
#include <unistd.h>
{
unsigned int uid;
unsigned char *data;
int expunges;
if (seq == 1)
end_offset = 0;
else {
/* we need to find offset to beginning of From-line.
not the fastest way maybe, but easiest.. */
return FALSE;
/* get back to the deleted record */
}
return FALSE;
/* save UID before deletion */
return FALSE;
if (expunge_func != NULL)
seq--;
if (!expunges) {
/* first expunged record, seek to position
where we want to begin writing */
return FALSE;
}
} else if (expunges) {
/* seek to wanted input position, and copy
this messages */
/* we're writing to beginning of mbox, so we
don't want the [\r]\n there */
&size, 1);
}
copy_size) < 0)
return FALSE;
}
seq++;
}
/* copy the rest as well, should be only \n but someone might
as well just appended more data.. */
}
{
unsigned int seq;
return FALSE;
/* no deleted messages */
return TRUE;
}
if (fd == -1) {
"Error opening mbox file %s: %m",
return FALSE;
}
return FALSE;
}
MAIL_MMAP_BLOCK_SIZE, 0);
/* we moved some of the data. move the rest as well so there
won't be invalid holes in mbox file */
}
"for mbox file %s: %m",
}
return !failed;
}