virtual-mail.c revision 45d47bc4660fe4bbb07817c9580deef9cca63646
/* Copyright (c) 2008-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "index-mail.h"
#include "virtual-storage.h"
#include "virtual-transaction.h"
struct virtual_mail {
struct index_mail imail;
struct mailbox_header_lookup_ctx *wanted_headers;
/* currently active mail */
struct mail *backend_mail;
/* all allocated mails */
/* mail is lost if backend_mail doesn't point to correct mail */
unsigned int lost:1;
};
struct mail *
virtual_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers)
{
struct virtual_mail *vmail;
sizeof(void *), 5);
if (wanted_headers != NULL) {
}
}
{
unsigned int i, count;
for (i = 0; i < count; i++)
}
static struct mail *
{
unsigned int i, count;
for (i = 0; i < count; i++) {
return mails[i];
}
return NULL;
}
struct mail *
struct virtual_backend_box *bbox)
{
struct mailbox_transaction_context *backend_trans;
struct mailbox_header_lookup_ctx *backend_headers;
if (backend_headers != NULL)
return vmail->backend_mail;
}
{
struct virtual_backend_box *bbox;
const struct virtual_mail_index_record *vrec;
const void *data;
bool expunged;
} else {
}
}
{
return FALSE;
return TRUE;
}
{
}
{
}
{
}
static void
enum mail_fetch_field fields,
struct mailbox_header_lookup_ctx *headers)
{
}
{
return 0;
return -1;
}
static int
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
static int
{
int tz;
if (timezone_r == NULL)
timezone_r = &tz;
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
static int
bool decode_to_utf8, const char **value_r)
{
int ret;
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
if (ret < 0) {
return -1;
}
return ret;
}
static int
bool decode_to_utf8, const char *const **value_r)
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
decode_to_utf8, value_r) < 0) {
return -1;
}
return 0;
}
static int
struct mailbox_header_lookup_ctx *headers,
{
struct mailbox_header_lookup_ctx *backend_headers;
int ret;
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
stream_r);
if (ret < 0) {
return -1;
}
return 0;
}
static int
struct message_size *hdr_size,
struct message_size *body_size,
{
int ret;
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
if (get_body) {
stream_r);
} else {
stream_r);
}
if (ret < 0) {
return -1;
}
return 0;
}
static int
const char **value_r)
{
if (virtual_mail_handle_lost(vmail) < 0)
return -1;
return -1;
}
return 0;
}
{
}
{
}
{
if (virtual_mail_handle_lost(vmail) < 0)
return;
}
static void
{
if (virtual_mail_handle_lost(vmail) < 0)
return;
}
struct mail_vfuncs virtual_mail_vfuncs = {
NULL,
};