sdbox-sync-rebuild.c revision ca98d6a1bbe73499da758a36bfab2963375c8d06
/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "dbox-sync-rebuild.h"
#include "sdbox-storage.h"
#include "sdbox-file.h"
#include "sdbox-sync.h"
#include <stdlib.h>
#include <dirent.h>
{
/* if uidvalidity is set in the old index, use it */
if (uid_validity == 0)
}
{
bool deleted;
int ret;
if (deleted)
return 0;
}
if (ret <= 0) {
if (ret < 0)
return -1;
return 0;
}
T_BEGIN {
} T_END;
return 0;
}
static int
{
unsigned long uid;
char *p;
int ret;
strlen(SDBOX_MAIL_FILE_PREFIX)) != 0)
return 0;
i_warning("dbox %s: Ignoring invalid filename %s",
return 0;
}
if (!primary)
return ret;
}
{
struct dirent *d;
int ret = 0;
if (!primary) {
/* alt directory doesn't exist, ignore */
return 0;
}
return -1;
}
"opendir(%s) failed: %m", path);
return -1;
}
do {
errno = 0;
break;
} while (ret >= 0);
if (errno != 0) {
"readdir(%s) failed: %m", path);
ret = -1;
}
"closedir(%s) failed: %m", path);
ret = -1;
}
return ret;
}
{
struct sdbox_index_header hdr;
}
static int
{
int ret = 0;
ret = -1;
return ret;
}
{
struct dbox_sync_rebuild_context *ctx;
struct mail_index_view *view;
struct mail_index_transaction *trans;
int ret;
if (ret < 0)
else
if (ret == 0)
return ret;
}