virtual-mail.c revision 0dffa25d211be541ee3c953b23566a1a990789df
/* Copyright (c) 2008-2016 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 *cur_backend_mail;
struct virtual_mail_index_record cur_vrec;
/* all allocated mails */
/* mail is lost if backend_mail doesn't point to correct mail */
bool cur_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++) {
}
}
{
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 **backend_mail_r)
{
struct virtual_backend_box *bbox;
*backend_mail_r = NULL;
return -1;
}
return 0;
}
return -1;
}
}
return -1;
}
return 0;
}
struct mail *
struct virtual_backend_box *bbox)
{
struct mail_private *backend_pmail;
struct mailbox_transaction_context *backend_trans;
struct mailbox_header_lookup_ctx *backend_headers;
if (backend_headers != NULL)
return vmail->cur_backend_mail;
}
{
const void *data;
}
{
return FALSE;
return TRUE;
}
{
struct mail *backend_mail;
struct mail_private *p;
return;
p = (struct mail_private *)backend_mail;
}
{
struct mail *backend_mail;
struct mail_private *p;
return TRUE;
p = (struct mail_private *)backend_mail;
return p->v.prefetch(backend_mail);
}
{
struct mail *backend_mail;
struct mail_private *p;
return;
p = (struct mail_private *)backend_mail;
p->v.precache(backend_mail);
}
static void
enum mail_fetch_field fields,
struct mailbox_header_lookup_ctx *headers)
{
struct mail *backend_mail;
struct mail_private *p;
return;
p = (struct mail_private *)backend_mail;
}
static int
{
struct mail *backend_mail;
return -1;
return -1;
}
return 0;
}
static int
{
struct mail *backend_mail;
int tz;
if (timezone_r == NULL)
timezone_r = &tz;
return -1;
return -1;
}
return 0;
}
{
struct mail *backend_mail;
return -1;
return -1;
}
return 0;
}
{
struct mail *backend_mail;
return -1;
return -1;
}
return 0;
}
{
struct mail *backend_mail;
return -1;
return -1;
}
return 0;
}
{
struct mail *backend_mail;
return -1;
return -1;
}
return 0;
}
static int
bool decode_to_utf8, const char **value_r)
{
struct mail *backend_mail;
struct mail_private *p;
int ret;
return -1;
p = (struct mail_private *)backend_mail;
if (ret < 0) {
return -1;
}
return ret;
}
static int
bool decode_to_utf8, const char *const **value_r)
{
struct mail *backend_mail;
struct mail_private *p;
return -1;
p = (struct mail_private *)backend_mail;
return -1;
}
return 0;
}
static int
struct mailbox_header_lookup_ctx *headers,
{
struct mail *backend_mail;
struct mailbox_header_lookup_ctx *backend_headers;
int ret;
return -1;
if (ret < 0) {
return -1;
}
return 0;
}
static int
struct message_size *hdr_size,
struct message_size *body_size,
{
struct mail *backend_mail;
int ret;
return -1;
if (get_body) {
stream_r);
} else {
}
if (ret < 0) {
return -1;
}
return 0;
}
static int
const char **value_r)
{
struct mail *backend_mail;
return -1;
return -1;
}
return 0;
}
{
return NULL;
return NULL;
return real_mail;
}
{
struct mail *backend_mail;
return;
}
{
struct mail *backend_mail;
return;
}
static void
enum mail_fetch_field field,
const char *reason)
{
struct mail *backend_mail;
return;
}
static void
{
}
struct mail_vfuncs virtual_mail_vfuncs = {
NULL,
};