/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "hex-binary.h"
#include "mail-index-private.h"
#include "mail-transaction-log-private.h"
#include "doveadm-dump.h"
#include <stdio.h>
unsigned int *version_r)
{
const unsigned char *data;
int ret;
if (ret <= 0) {
}
}
}
{
const char *name;
switch (type & MAIL_TRANSACTION_TYPE_MASK) {
name = "expunge";
break;
name = "expunge-guid";
break;
case MAIL_TRANSACTION_APPEND:
name = "append";
break;
name = "flag-update";
break;
name = "header-update";
break;
name = "ext-intro";
break;
name = "ext-reset";
break;
name = "ext-hdr";
break;
name = "ext-hdr32";
break;
name = "ext-rec";
break;
name = "keyword-update";
break;
name = "keyword-reset";
break;
name = "ext-atomic-inc";
break;
name = "modseq-update";
break;
name = "index-deleted";
break;
name = "index-undeleted";
break;
name = "boundary";
break;
name = "attribute-update";
break;
default:
break;
}
if ((type & MAIL_TRANSACTION_EXTERNAL) != 0)
if ((type & MAIL_TRANSACTION_SYNC) != 0)
return name;
}
{
size_t i;
for (i = 0; i < size; i++)
if (size == 4) {
printf(" (dec=%u)", *n);
}
}
{
size_t i;
switch (size) {
case 1: {
printf("%u", *n);
break;
}
case 2: {
break;
}
case 4: {
break;
}
case 8: {
break;
}
default:
for (i = 0; i < size; i++)
}
}
sizeof(((struct mail_index_header *)0)->field) }
static struct {
const char *name;
} header_fields[] = {
};
{
unsigned int i;
return;
}
while (size > 0) {
/* don't bother trying to handle header updates that include
unknown/unexpected fields offsets/sizes */
for (i = 0; i < N_ELEMENTS(header_fields); i++) {
break;
}
if (i == N_ELEMENTS(header_fields)) {
printf("\n");
break;
}
printf("\n");
}
}
{
printf(" - uids=");
}
printf("\n");
break;
}
printf(")\n");
}
break;
}
case MAIL_TRANSACTION_APPEND: {
printf(" - uids=");
printf(",");
}
printf("\n");
break;
}
case MAIL_TRANSACTION_FLAG_UPDATE: {
const struct mail_transaction_flag_update *u = data;
printf(" - uids=%u-%u (flags +%x-%x, modseq_inc_flag=%d)\n",
}
break;
}
case MAIL_TRANSACTION_HEADER_UPDATE: {
const struct mail_transaction_header_update *u = data;
break;
}
case MAIL_TRANSACTION_EXT_INTRO: {
prev_intro = *intro;
*modseq = 1;
}
break;
}
case MAIL_TRANSACTION_EXT_RESET: {
break;
}
case MAIL_TRANSACTION_EXT_HDR_UPDATE: {
const struct mail_transaction_ext_hdr_update *u = data;
printf(": ");
} else {
printf(" (too large)");
}
printf("\n");
break;
}
const struct mail_transaction_ext_hdr_update32 *u = data;
printf(": ");
} else {
printf(" (too large)");
}
printf("\n");
break;
}
case MAIL_TRANSACTION_EXT_REC_UPDATE: {
else
printf("(record_size too large)");
printf("\n");
}
break;
}
case MAIL_TRANSACTION_EXT_ATOMIC_INC: {
else
}
break;
}
case MAIL_TRANSACTION_KEYWORD_UPDATE: {
const struct mail_transaction_keyword_update *u = data;
unsigned int uid_offset;
printf(" - modify=%d, name=%.*s, uids=",
uid_offset = sizeof(*u) + u->name_size +
size -= uid_offset;
}
printf("\n");
break;
}
case MAIL_TRANSACTION_KEYWORD_RESET: {
const struct mail_transaction_keyword_reset *u = data;
printf(" - uids=");
}
printf("\n");
break;
}
case MAIL_TRANSACTION_MODSEQ_UPDATE: {
rec->modseq_low32);
}
break;
}
break;
case MAIL_TRANSACTION_BOUNDARY: {
break;
}
if (keys[i] == '+')
extra_count++;
extra_count++;
}
if (i % sizeof(uint32_t) != 0)
printf(" - broken entry\n");
break;
}
extra_pos = 0;
printf(" - %s: %s/%s : timestamp=%s",
if (keys[i] == '+')
printf("\n");
}
break;
}
default:
break;
}
}
unsigned int version)
{
unsigned int hdr_size;
const unsigned char *data;
int ret;
if (ret <= 0) {
if (size == 0)
return 0;
}
"type=%s, size=broken (%x)\n",
return 0;
}
if (ret <= 0) {
}
if (*modseq > prev_modseq)
printf("\n");
return 1;
}
{
unsigned int version;
int ret;
do {
T_BEGIN {
} T_END;
} while (ret > 0);
}
{
const char *p;
int fd;
if (p == NULL)
p = path;
p = strstr(p, ".log");
return FALSE;
if (fd == -1)
return FALSE;
i_close_fd(&fd);
return ret;
}
"log",
};