maildir-index.c revision a4663ce76645f28d521c7461abecb44537207cb2
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "str.h"
#include "maildir-index.h"
#include "mail-index-data.h"
#include "mail-index-util.h"
#include <stdio.h>
extern struct mail_index maildir_index;
enum mail_index_open_flags flags)
{
}
enum mail_flags default_flags)
{
const char *info;
enum mail_flags flags;
return default_flags;
flags = 0;
switch (*info) {
case 'R': /* replied */
flags |= MAIL_ANSWERED;
break;
case 'S': /* seen */
break;
case 'T': /* trashed */
flags |= MAIL_DELETED;
break;
case 'D': /* draft */
flags |= MAIL_DRAFT;
break;
case 'F': /* flagged */
flags |= MAIL_FLAGGED;
break;
default:
/* custom flag */
*info-'a');
break;
}
/* unknown flag - ignore */
break;
}
}
return flags;
}
{
int i, nextflag;
/* remove the old :info from file name, and get the old flags */
oldflags = "";
}
/* insert the new flags between old flags. flags must be sorted by
their ASCII code. unknown flags are kept. */
for (;;) {
/* skip all known flags */
*oldflags == 'T' ||
oldflags++;
(unsigned char) *oldflags;
flags &= ~MAIL_DRAFT;
}
flags &= ~MAIL_FLAGGED;
}
flags &= ~MAIL_ANSWERED;
}
}
flags &= ~MAIL_DELETED;
}
for (i = 0; i < MAIL_CUSTOM_FLAGS_COUNT; i++) {
}
}
break;
oldflags++;
}
if (*oldflags == ',') {
/* another flagset, we don't know about these, just keep them */
while (*oldflags != '\0')
}
}
{
struct mail_index *index;
return index;
}
{
}
struct mail_index_record *rec)
{
const char *fname;
/* try getting it from cache */
return date;
/* stat() gives it */
return (time_t)-1;
}
return (time_t)-1;
}
}
struct mail_index_record *rec,
int external_change)
{
struct mail_index_update *update;
/* we need to update the flags in the file name */
return FALSE;
}
/* minor problem: new_path is overwritten if it exists.. */
"rename(%s, %s) failed: %m",
return FALSE;
}
/* update the filename in index */
return FALSE;
}
return FALSE;
return TRUE;
}
struct mail_index maildir_index = {
};