maildir-uidlist.c revision e7912167935f67b3dc68c80bf80d719bb1cdc533
1273N/A#include "hex-binary.h"
1273N/A#include "file-dotlock.h"
1273N/A#include "close-keep-errno.h"
1273N/A#include "nfs-workarounds.h"
1273N/A#include "eacces-error.h"
1273N/A#include "maildir-storage.h"
1273N/A#include "maildir-sync.h"
1273N/A#include "maildir-filename.h"
1273N/A#include "maildir-uidlist.h"
1273N/Astruct maildir_uidlist_rec {
1273N/Astruct maildir_uidlist {
1273N/A unsigned int lock_count;
1273N/A unsigned int change_counter;
1273N/A unsigned int hdr_next_uid;
1273N/Astruct maildir_uidlist_sync_ctx {
1273N/A unsigned int new_files_count;
1273N/A unsigned int finish_change_counter;
1273N/Astruct maildir_uidlist_iter_ctx {
1273N/A unsigned int change_counter;
1273N/A bool refresh_when_locked)
1273N/A const char *control_dir;
const char *fmt, ...)
return idx;
const char **line_p,
line++;
return FALSE;
return TRUE;
const char *line)
unsigned int count;
uid = 0;
line++;
line);
return FALSE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
bool ret;
T_BEGIN {
rec);
} T_END;
if (!ret) {
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
const char *line,
unsigned int *uid_validity_r,
unsigned int *next_uid_r)
char key;
const char *value;
switch (key) {
const char *line;
int ret;
case UIDLIST_VERSION:
T_BEGIN {
&next_uid);
} T_END;
if (ret < 0)
const char *line;
last_read_offset = 0;
if (ret > 0) {
ret = 0;
orig_uid_validity != 0) {
if (ret == 0) {
} else if (ret > 0) {
} else if (!*retry_r) {
if (ret <= 0) {
return ret;
int ret;
bool recreated;
int ret;
if (ret <= 0) {
if (!recreated)
bool retry;
int ret;
if (!retry)
if (ret >= 0) {
return ret;
int ret;
return ret;
const char **fname_r)
int ret;
if (ret <= 0) {
if (ret < 0)
return ret;
const char **fname_r)
int ret;
return ret;
int ret;
return NULL;
if (*p == (unsigned char)key)
return NULL;
const char *value)
unsigned int len;
int ret;
if (ret <= 0) {
if (ret < 0)
if (*p != (unsigned char)key)
p += len;
const char *value)
T_BEGIN {
} T_END;
unsigned int len;
int ret;
if (ret < 0) {
unsigned int i, count;
seq++;
seq++; i++;
for (; i < count; i++)
if (ret == 0) {
if (ret < 0) {
if (ret < 0)
return ret;
int ret;
return ret;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return TRUE;
bool nonsynced)
unsigned int i, count;
if (nonsynced) {
for (i = 0; i < count; i++)
for (i = 0; i < count; i++)
bool *locked_r)
int ret;
if (ret <= 0) {
return ret;
bool locked;
int ret;
if (ret <= 0)
return ret;
if (uid != 0) {
unsigned char *ret;
return NULL;
T_BEGIN {
unsigned int len;
} T_END;
return ret;
const char *filename,
const char *p, *dir;
MAILDIR_UIDLIST_REC_FLAG_MOVED)) == 0) {
if (uid != 0) {
const char *filename)
unsigned int idx;
const char *filename)
return FALSE;
return TRUE;
const char *filename)
T_BEGIN {
} T_END;
bool success)
int ret;
if (!success)
return ret;
const char *filename,
struct maildir_uidlist_iter_ctx *
unsigned int count;
return ctx;
idx++;
idx--;
return FALSE;
return TRUE;
const char **filename_r)
return FALSE;
return TRUE;