mail-transaction-util.c revision e06c0b65c16ccce69bbee009ead14d7d3d17a256
/* Copyright (C) 2004 Timo Sirainen */
#include "lib.h"
#include "buffer.h"
#include "mail-index-private.h"
#include "mail-transaction-log.h"
#include "mail-transaction-util.h"
struct mail_transaction_expunge_iter_ctx {
const struct mail_transaction_expunge *expunges;
};
const struct mail_transaction_type_map mail_transaction_type_map[] = {
sizeof(struct mail_index_record) },
sizeof(struct mail_transaction_expunge) },
sizeof(struct mail_transaction_flag_update) },
sizeof(struct mail_transaction_cache_update) },
{ 0, 0, 0 }
};
const struct mail_transaction_type_map *
{
int i;
for (i = 0; mail_transaction_type_map[i].type != 0; i++) {
return &mail_transaction_type_map[i];
}
return NULL;
}
{
enum mail_transaction_type type = 0;
int i;
for (i = 0; mail_transaction_type_map[i].type != 0; i++) {
}
return type;
}
const void *data,
struct mail_transaction_map_functions *map,
void *context)
{
int ret = 0;
case MAIL_TRANSACTION_APPEND: {
break;
if (ret <= 0)
break;
}
break;
}
case MAIL_TRANSACTION_EXPUNGE:
break;
if (ret <= 0)
break;
}
break;
}
case MAIL_TRANSACTION_FLAG_UPDATE: {
break;
if (ret <= 0)
break;
}
break;
}
case MAIL_TRANSACTION_CACHE_UPDATE: {
break;
if (ret <= 0)
break;
}
break;
}
case MAIL_TRANSACTION_HEADER_UPDATE: {
const struct mail_transaction_header_update *rec;
unsigned int i;
break;
if (ret <= 0)
break;
}
break;
}
default:
i_unreached();
}
return ret;
}
void
const struct mail_transaction_expunge *src,
{
const struct mail_transaction_expunge *src_end;
struct mail_transaction_expunge *dest;
struct mail_transaction_expunge new_exp;
/* @UNSAFE */
dest_count /= sizeof(*dest);
/* src[] must be sorted. */
for (; i < dest_count; i++) {
break;
}
first = i;
i++;
}
/* continue previous record */
} else if (i == first) {
i++; first++;
dest_count++;
} else {
/* use next record */
first++;
}
if (i > first) {
dest_count -= i - first;
i = first;
}
}
}