dict-fs.c revision d470d4adddfddc42b6f4f319abb5c5ec7c26e3ba
/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "fs-api.h"
#include "istream.h"
#include "str.h"
#include "dict-transaction-memory.h"
#include "dict-private.h"
struct fs_dict {
char *username;
};
struct fs_dict_iterate_context {
struct dict_iterate_context ctx;
const char **paths;
unsigned int path_idx;
enum dict_iterate_flags flags;
char *error;
};
static int
const struct dict_settings *set,
{
struct fs_settings fs_set;
if (p == NULL) {
fs_args = "";
} else {
fs_args = p+1;
}
return -1;
return 0;
}
{
}
{
} else {
i_unreached();
}
}
{
const unsigned char *data;
const char *path;
int ret;
}
if (input->stream_errno == 0) {
ret = 1;
} else {
ret = 0;
else {
}
}
return ret;
}
static struct dict_iterate_context *
enum dict_iterate_flags flags)
{
struct fs_dict_iterate_context *iter;
/* these flags are not supported for now */
DICT_ITERATE_FLAG_SORT_BY_VALUE)) == 0);
}
{
struct fs_dict_iterate_context *iter =
(struct fs_dict_iterate_context *)ctx;
int ret;
return FALSE;
return FALSE;
}
return FALSE;
}
return TRUE;
}
/* I/O error */
return FALSE;
} else if (ret == 0) {
/* file was just deleted, just skip to next one */
}
return TRUE;
}
const char **error_r)
{
struct fs_dict_iterate_context *iter =
(struct fs_dict_iterate_context *)ctx;
int ret;
}
return ret;
}
static struct dict_transaction_context *
{
struct dict_transaction_memory_context *ctx;
}
const char **error_r)
{
const struct dict_transaction_memory_change *change;
const char *key;
int ret = 0;
case DICT_CHANGE_TYPE_SET:
"fs_write(%s) failed: %s", key,
ret = -1;
}
break;
case DICT_CHANGE_TYPE_UNSET:
"fs_delete(%s) failed: %s", key,
ret = -1;
}
break;
case DICT_CHANGE_TYPE_INC:
i_unreached();
}
if (ret < 0)
return -1;
}
return 0;
}
static void
bool async ATTR_UNUSED,
void *context)
{
struct dict_transaction_memory_context *ctx =
(struct dict_transaction_memory_context *)_ctx;
}
struct dict dict_driver_fs = {
.name = "fs",
{
NULL,
NULL,
NULL,
}
};