mail-index-transaction-sort-appends.c revision 1731683fb0c6afceb20903b1c0a45912d00ed5da
/* Copyright (c) 2003-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "seq-range-array.h"
#include "mail-index-private.h"
#include "mail-index-transaction-private.h"
#include <stdlib.h>
struct uid_map {
};
{
}
static void
const uint32_t *old_to_newseq_map)
{
unsigned int ext_count;
unsigned int i, j, count;
if (!array_is_created(updates))
return;
for (j = 0; j < count; j++) {
old_array = &ext_rec_arrays[j];
if (!array_is_created(old_array))
continue;
for (i = 0; i < ext_count; i++) {
}
ext_rec_arrays[j] = new_array;
}
}
static void
const uint32_t *old_to_newseq_map)
{
unsigned int i, count;
for (i = 0; i < count; i++) {
break;
}
if (i == count) {
/* nothing to do */
return;
}
i++;
}
for (i = 0; i < count; i++) {
}
}
static void
const uint32_t *old_to_newseq_map)
{
if (!array_is_created(&t->keyword_updates))
return;
t->first_new_seq,
}
t->first_new_seq,
}
}
}
void mail_index_transaction_sort_appends(struct mail_index_transaction *t)
{
struct uid_map *new_uid_map;
unsigned int i, count;
if (!array_is_created(&t->appends))
return;
if (!t->appends_nonsorted) {
#ifdef DEBUG
for (i = 1; i < count; i++)
#endif
return;
}
/* first make a copy of the UIDs and map them to sequences */
for (i = 0; i < count; i++) {
new_uid_map[i].idx = i;
}
/* now sort the UID map */
/* sort mail records */
for (i = 1; i < count; i++) {
i_panic("Duplicate UIDs added in transaction");
}
sizeof(*sorted_recs) * count);
for (i = 0; i < count; i++)
t->first_new_seq,
t->first_new_seq,
t->appends_nonsorted = FALSE;
}