maildir-mail.c revision 439980f88f421039dea8335e92d3fa82b3f470a1
/* Copyright (C) 2003 Timo Sirainen */
#include "lib.h"
#include "istream.h"
#include "index-mail.h"
#include "maildir-storage.h"
#include "maildir-uidlist.h"
#include <fcntl.h>
#include <unistd.h>
{
if (*fd != -1)
return 1;
return 0;
"open(%s) failed: %m", path);
return -1;
}
{
return 1;
return 0;
"stat(%s) failed: %m", path);
return -1;
}
static struct istream *
{
int fd;
fd = -1;
return NULL;
if (fd == -1) {
return NULL;
}
if (ibox->mail_read_mmaped) {
MAIL_MMAP_BLOCK_SIZE, 0, 0, TRUE);
} else {
}
}
{
int fd;
(void)index_mail_get_received_date(_mail);
return data->received_date;
/* we're going to open the mail anyway */
}
"fstat(maildir) failed: %m");
return (time_t)-1;
}
} else {
return (time_t)-1;
}
return data->received_date;
}
{
const char *fname, *p;
}
return (uoff_t)-1;
/* size can be included in filename */
if (p != NULL) {
p += 3;
virtual_size = 0;
while (*p >= '0' && *p <= '9') {
p++;
}
if (*p == ':' || *p == ',' || *p == '\0') {
&virtual_size, sizeof(virtual_size));
return virtual_size;
}
}
return index_mail_get_size(_mail);
}
struct message_size *hdr_size,
struct message_size *body_size)
{
int deleted;
&deleted);
return NULL;
}
}
}
struct mail maildir_mail = {
0, 0, 0, 0, 0, 0,
};