maildir-build.c revision 78d703849ec3c66909d2c461683405378b940189
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "maildir-index.h"
#include "mail-index-data.h"
#include "mail-index-util.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
static MailIndexRecord *
unsigned int *uid)
{
return NULL;
return rec;
}
const char *fname)
{
unsigned int uid;
int failed;
/* check that file size is somewhat reasonable */
return FALSE;
}
/* This cannot be a mail file - delete it */
return TRUE;
}
return FALSE;
/* append the file into index */
return FALSE;
/* set message flags from file name */
/* set the location */
/* parse the header and update record's fields */
return FALSE;
/* make sure everything is written before setting it's UID
to mark it as non-deleted. */
return FALSE;
return TRUE;
}
const char *fname)
{
const char *path;
if (fd == -1) {
/* open() failed - treat it as error unless the error was
"file doesn't exist" in which case someone just managed
to delete it before we saw it */
return TRUE;
return FALSE;
}
return ret;
}
const char *dest_dir)
{
const char *final_dir;
struct dirent *d;
int failed;
return FALSE;
}
if (d->d_name[0] == '.')
continue;
/* move the file into dest_dir - abort everything if it
already exists, as that should never happen */
source_dir, d->d_name);
"%s: file already exists",
break;
}
/* race condition here - ignore it as the chance of it
happening is pretty much zero */
"rename(%s, %s) failed: %m",
break;
}
}
t_push();
d->d_name);
t_pop();
}
return !failed;
}