mail-index-transaction-view.c revision b20fb5b1df9d604a7541f5118fc5b4b466d211ef
/* Copyright (C) 2004 Timo Sirainen */
#include "lib.h"
#include "buffer.h"
#include "mail-index-private.h"
#include "mail-index-view-private.h"
#include "mail-index-transaction-private.h"
struct mail_index_view_transaction {
struct mail_index_view view;
struct mail_index_view_methods *parent;
struct mail_index_transaction *t;
};
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
}
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
return view->messages_count +
(tview->t->last_new_seq == 0 ? 0 :
}
static const struct mail_index_header *
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
/* FIXME: header counters may not be correct */
}
struct mail_index_map **map_r,
const struct mail_index_record **rec_r)
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
/* FIXME: is this right to return index map..?
it's not there yet. */
return 1;
} else {
}
}
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
return 0;
} else {
}
}
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
first_seq_r, last_seq_r) < 0)
return -1;
/* FIXME: we don't need this function yet.. new UIDs might be 0 as
well.. */
if (*first_seq_r == 0) {
/* nothing found, either doesn't exist or it's completely
newly appended. */
/* last_seq_r may be growed from transactions */
}
return 0;
}
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
const struct mail_index_record *rec;
return -1;
if (*seq_r != 0)
return 0;
break;
}
}
return 0;
}
static int
const void **data_r)
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
const struct mail_index_ext *ext;
size = 0;
} else {
}
/* not updated, return the existing value */
}
return 1;
}
return 1;
}
{
struct mail_index_view_transaction *tview =
(struct mail_index_view_transaction *)view;
/* FIXME: check updates */
}
static struct mail_index_view_methods view_methods = {
};
struct mail_index_view *
{
struct mail_index_view_transaction *tview;
/* transaction view is being synced. while it's done, it's not
possible to add new messages, but the view itself might
change. so we can't make a copy of the view. */
mail_index_view_ref(t->view);
return t->view;
}
tview->t = t;
}