mail-index-view.c revision cdb3c8e1054f4ea382bb6c1557fd28d067f90e5e
76b43e4417bab52e913da39b5f5bc2a130d3f149Timo Sirainen/* Copyright (C) 2003-2004 Timo Sirainen */
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainenvoid mail_index_view_clone(struct mail_index_view *dest,
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen dest->log_view = mail_transaction_log_view_open(src->index->log);
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainenvoid mail_index_view_ref(struct mail_index_view *view)
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainenstatic void _view_close(struct mail_index_view *view)
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen mail_transaction_log_view_close(view->log_view);
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainenint mail_index_view_lock_head(struct mail_index_view *view, int update_index)
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen unsigned int lock_id;
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen if (MAIL_INDEX_MAP_IS_IN_MEMORY(view->index->map))
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen if (!mail_index_is_locked(view->index, view->lock_id)) {
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen if (mail_index_lock_shared(view->index, update_index,
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen if (mail_index_map(view->index, FALSE) <= 0) {
906520ee2cece20c875835697db08cd5e29b919bTimo Sirainen /* index was rebuilt */
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen if (mail_index_lock_shared(view->index, TRUE, &lock_id) < 0)
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen mail_index_unlock(view->index, view->lock_id);
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainenint mail_index_view_lock(struct mail_index_view *view)
f877ee033a0737100c2f661a7ca4c559ea2ddb8aTimo Sirainen return mail_index_view_lock_head(view, FALSE);
for (i = 0; i < size; i++) {
for (i = 0; i < size; i++)
static const struct mail_index_header *
if (seq == 0) {
seq--;
} while (seq > 0);
int nearest_side)
if (nearest_side > 0) {
*first_seq_r = 0;
*last_seq_r = 0;
left_idx = 0;
if (*first_seq_r == 0 ||
*first_seq_r = 0;
*last_seq_r = 0;
#define LOW_UPDATE(x) \
*seq_r = 0;
if (seq == 0)
const void **data_r)
int ret;
return ret;
return ret;
*data_size_r = 0;
const struct mail_index_header *
const void *data;
const unsigned int *keyword_idx_map;
int ret;
if (ret < 0)
return ret;
keyword_count = 0;
if (((const unsigned char *)data)[i] == 0)
map) < 0)
return ret;
return ret;
const void **data_r)
return view;
const struct mail_index_ext *