maildir-uidlist.h revision c820b702d1eabfd5b029ac168fe769265e541561
#ifndef MAILDIR_UIDLIST_H
#define MAILDIR_UIDLIST_H
#include "mail-storage.h"
#define MAILDIR_UIDLIST_NAME "dovecot-uidlist"
/* how many seconds to wait before overriding uidlist.lock */
struct index_mailbox;
struct maildir_mailbox;
struct maildir_uidlist;
struct maildir_uidlist_sync_ctx;
enum maildir_uidlist_sync_flags {
MAILDIR_UIDLIST_SYNC_PARTIAL = 0x01,
MAILDIR_UIDLIST_SYNC_KEEP_STATE = 0x02,
MAILDIR_UIDLIST_SYNC_FORCE = 0x04,
MAILDIR_UIDLIST_SYNC_TRYLOCK = 0x08,
MAILDIR_UIDLIST_SYNC_NOREFRESH = 0x10,
MAILDIR_UIDLIST_SYNC_NOLOCK = 0x20
};
enum maildir_uidlist_rec_flag {
MAILDIR_UIDLIST_REC_FLAG_NEW_DIR = 0x01,
MAILDIR_UIDLIST_REC_FLAG_MOVED = 0x02,
MAILDIR_UIDLIST_REC_FLAG_RECENT = 0x04,
};
enum maildir_uidlist_hdr_ext_key {
MAILDIR_UIDLIST_HDR_EXT_GUID = 'G',
/* POP3 UIDL format unless overridden by records */
};
enum maildir_uidlist_rec_ext_key {
/* Physical message size. If filename also contains ,S=<vsize> this
isn't written to uidlist. */
/* Virtual message size. If filename also contains ,W=<vsize> this
isn't written to uidlist. */
/* POP3 UIDL overriding the default format */
};
struct maildir_uidlist *
/* Returns -1 if error, 0 if file is broken or lost, 1 if ok. If nfs_flush=TRUE
and storage has NFS_FLUSH flag set, the NFS attribute cache is flushed to
make sure that we see the latest uidlist file. */
/* Like maildir_uidlist_refresh(), but if uidlist isn't opened yet, try to
fill in the uidvalidity/nextuid from index file instead. */
/* Look up uidlist record for given filename. Returns 1 if found,
0 if not found, -1 if error */
enum maildir_uidlist_rec_flag *flags_r,
const char **fname_r);
enum maildir_uidlist_rec_flag *flags_r,
const char **fname_r);
/* Returns extension's value or NULL if it doesn't exist. */
const char *
enum maildir_uidlist_rec_ext_key key);
/* Update extended record. value=NULL removes the key. */
const char *value);
/* If uidlist has changed, update it. This is mostly meant to be used with
maildir_uidlist_set_ext() */
/* Sync uidlist with what's actually on maildir. Returns same as
maildir_uidlist_lock(). */
struct maildir_uidlist_sync_ctx **sync_ctx_r);
const char *filename,
enum maildir_uidlist_rec_flag flags);
enum maildir_uidlist_rec_flag flags);
const char *filename);
const char *
const char *filename);
bool success);
const char *
const char *filename);
const char *filename,
enum maildir_uidlist_rec_flag flags);
/* List all maildir files. */
struct maildir_uidlist_iter_ctx *
enum maildir_uidlist_rec_flag *flags_r,
const char **filename_r);
#endif