mail-index-view.c revision f99575e1d6cd251bd7b6d0654bd75b475e6a894c
/* 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;
}
{
}
{
return -1;
return -1;
}
/* index was rebuilt */
return -1;
}
} else if (update_index) {
// FIXME: check if we need to reopen it!
}
return 0;
}
{
if (view->inconsistent)
return -1;
/* not head mapping, no need to lock */
return 0;
}
}
{
}
}
{
}
{
return view->inconsistent;
}
{
}
{
view->transactions++;
}
{
view->transactions--;
}
const struct mail_index_header **hdr_r)
{
if (mail_index_view_lock(view) < 0)
return -1;
return 0;
}
const struct mail_index_record **rec_r)
{
struct mail_index_map *map;
const struct mail_index_record *rec;
if (mail_index_view_lock(view) < 0)
return -1;
return 0;
}
return -1;
/* look for it in the head mapping */
while (seq > 0) {
// FIXME: we could be skipping more by uid diff
break;
}
return 0;
}
{
if (mail_index_view_lock(view) < 0)
return -1;
return 0;
}
int nearest_side)
{
const struct mail_index_record *rec;
idx = 0;
left_idx = *left_idx_p;
else
break;
}
*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;
left_idx = 0;
if (*first_seq_r == 0 ||
*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;
}