mail-index-view.c revision 024815ea2ffdda9ea79919f18e865663977f73ea
/* Copyright (C) 2003-2004 Timo Sirainen */
#include "lib.h"
#include "buffer.h"
#include "file-lock.h"
#include "mail-index-view-private.h"
#include "mail-transaction-log.h"
{
struct mail_index_view *view;
return view;
}
{
}
{
/* not head mapping, no need to lock */
if (!view->map_protected) {
F_RDLCK) < 0)
return -1;
}
return 0;
}
{
unsigned int lock_id;
return -1;
return -1;
}
/* index was rebuilt */
return -1;
}
} else if (update_index) {
return -1;
}
/* mail_index_lock_shared() may have reopened the file,
so do this after it. */
if (mail_index_view_map_protect(view) < 0)
return -1;
}
return 0;
}
{
return -1;
if (mail_index_view_map_protect(view) < 0)
return -1;
return 0;
}
}
{
if (view->map_protected) {
F_UNLCK);
}
}
}
{
return view->messages_count;
}
{
return view->inconsistent;
}
{
}
{
view->transactions++;
}
{
view->transactions--;
}
const struct mail_index_header **hdr_r)
{
if (mail_index_view_lock(view) < 0)
return -1;
else {
/* messages_count differs, use a modified copy */
}
return 0;
}
struct mail_index_map **map_r,
const struct mail_index_record **rec_r)
{
struct mail_index_map *map;
if (mail_index_view_lock(view) < 0)
return -1;
return 0;
}
return -1;
/* look for it in the head mapping */
if (seq == 0) {
return 0;
}
do {
// FIXME: we could be skipping more by uid diff
seq--;
break;
} while (seq > 0);
return 0;
}
const struct mail_index_record **rec_r)
{
struct mail_index_map *map;
}
{
if (mail_index_view_lock(view) < 0)
return -1;
return 0;
}
{
const struct mail_index_record *rec;
struct mail_index_map *map;
return -1;
return 0;
}
/* FIXME: do data_id mapping conversion */
return 0;
}
int nearest_side)
{
else
break;
}
/* no messages available */
return 0;
}
*left_idx_p = left_idx;
if (nearest_side > 0) {
/* we want uid or larger */
} else {
/* we want uid or smaller */
}
}
return idx+1;
}
{
if (mail_index_view_lock(view) < 0)
return -1;
*first_seq_r = 0;
*last_seq_r = 0;
return 0;
}
}
left_idx = 0;
if (*first_seq_r == 0 ||
last_uid) {
*first_seq_r = 0;
*last_seq_r = 0;
return 0;
}
*last_seq_r = *first_seq_r;
return 0;
}
/* optimization - binary lookup only from right side: */
return 0;
}
{
#define LOW_UPDATE(x) \
const struct mail_index_record *rec;
*seq_r = 0;
if (mail_index_view_lock(view) < 0)
return -1;
if (low_uid == 1)
seq = 1;
else {
return -1;
if (seq == 0)
return 0;
}
break;
}
}
return 0;
}