/* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "buffer.h"
#include "llist.h"
#include "mail-index-view-private.h"
#include "mail-transaction-log.h"
struct mail_index_view *
{
return view;
}
const struct mail_index_view *src)
{
}
}
{
}
{
}
}
{
return view->inconsistent;
}
{
}
unsigned int
{
return view->transactions;
}
{
view->transactions++;
}
{
view->transactions--;
}
struct mail_index_map *map)
{
unsigned int i, count;
/* if map is already referenced, do nothing */
for (i = 0; i < count; i++) {
return;
}
} else {
}
/* reference the given mapping. the reference is dropped when the view
is synchronized or closed. */
}
{
unsigned int i, count;
return;
for (i = 0; i < count; i++)
mail_index_unmap(&maps[i]);
}
{
}
static const struct mail_index_header *
{
}
static const struct mail_index_record *
{
/* look up the record */
if (!view->inconsistent) {
"Corrupted Index file %s: Record [%u].uid=0",
}
/* we'll need to return something so the caller doesn't crash */
if (expunged_r != NULL)
*expunged_r = TRUE;
return &broken_rec;
}
/* view's mapping is latest. we can use it directly. */
if (expunged_r != NULL)
*expunged_r = FALSE;
return rec;
}
/* look up the record from head mapping. it may contain some changes.
start looking up from the same sequence as in the old view.
if there are no expunges, it's there. otherwise it's somewhere
before (since records can't be inserted).
usually there are only a few expunges, so just going downwards from
our initial sequence position is probably faster than binary
search. */
if (seq == 0) {
/* everything is expunged from head. use the old record. */
if (expunged_r != NULL)
*expunged_r = TRUE;
return rec;
}
do {
break;
} while (--seq > 0);
/* found it. use it. reference the index mapping so that the
returned record doesn't get invalidated after next sync. */
if (expunged_r != NULL)
*expunged_r = FALSE;
return head_rec;
} else {
/* expunged from head. use the old record. */
if (expunged_r != NULL)
*expunged_r = TRUE;
return rec;
}
}
{
}
{
}
{
#define LOW_UPDATE(x) \
*seq_r = 0;
if (low_uid == 1)
seq = 1;
else {
return;
}
break;
}
}
}
static void
const unsigned char *data,
{
const unsigned int *keyword_idx_map;
/* no keywords at all in index */
return;
}
&hdr_size, &record_size,
&record_align);
/* keyword_idx_map[] contains file => index keyword mapping */
return;
for (i = 0; i < record_size; i++) {
/* first do the quick check to see if there's keywords at all */
if (data[i] == 0)
continue;
if ((data[i] & (1 << j)) == 0)
continue;
if (idx >= keyword_count) {
/* extra bits set in keyword bytes.
shouldn't happen, but just ignore. */
break;
}
}
}
}
{
const void *data;
}
static const void *
{
return NULL;
}
static void
const void **data_r, bool *expunged_r)
{
}
{
/* no mapping given, use head mapping */
}
/* extension doesn't exist in this index file */
*data_size_r = 0;
return;
}
}
struct mail_index_map *map,
{
return FALSE;
return TRUE;
}
{
return;
}
{
}
const struct mail_index_header *
{
}
const struct mail_index_record *
{
}
const struct mail_index_record *
struct mail_index_map **map_r)
{
}
{
bool expunged;
return expunged;
}
{
const void *data;
else {
}
}
{
}
enum mail_flags *flags_r,
{
const unsigned char *keyword_data;
}
{
}
{
return *first_seq_r != 0;
}
{
return *seq_r != 0;
}
{
}
bool *expunged_r)
{
}
const void **data_r, bool *expunged_r)
{
}
{
}
{
}
struct mail_index_map *map,
{
}
{
/* extension doesn't exist in this index file */
*hdr_size_r = 0;
*record_size_r = 0;
*record_align_r = 0;
return;
}
}
};
struct mail_index_view *
struct mail_index_map *map)
{
view->v = view_vfuncs;
return view;
}
struct mail_index_view *
const char *source_filename, unsigned int source_linenum)
{
/* these can be used to debug mail_index_view_close() leaks */
return view;
}
const struct mail_index_ext *
{
return NULL;
}