dict-fs.c revision ac9600ec580ca6897d263b2f207f1571a09031fa
e59faf65ce864fe95dc00f5d52b8323cdbd0608aTimo Sirainen/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen const char **paths;
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainenfs_dict_init(struct dict *driver, const char *uri,
f98cd3b7ccfb026fb56c580b5c7c2e2ee5468049Timo Sirainen if (fs_init(fs_driver, fs_args, &fs_set, &fs, error_r) < 0)
458acd7b39c84bae0d18c36ff9ddff9a49b4ae4aTimo Sirainen struct fs_dict *dict = (struct fs_dict *)_dict;
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainenstatic const char *fs_dict_get_full_key(struct fs_dict *dict, const char *key)
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainen if (strncmp(key, DICT_PATH_SHARED, strlen(DICT_PATH_SHARED)) == 0)
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainen else if (strncmp(key, DICT_PATH_PRIVATE, strlen(DICT_PATH_PRIVATE)) == 0) {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen return t_strdup_printf("%s/%s", dict->username,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainenstatic int fs_dict_lookup(struct dict *_dict, pool_t pool,
458acd7b39c84bae0d18c36ff9ddff9a49b4ae4aTimo Sirainen struct fs_dict *dict = (struct fs_dict *)_dict;
55a14bce15b9f44441b5f56616d73651a294d770Timo Sirainen const unsigned char *data;
79f416d4000aa4192683207aea58a7b12ce66411Timo Sirainen file = fs_file_init(dict->fs, fs_dict_get_full_key(dict, key),
ret = 0;
return ret;
static struct dict_iterate_context *
DICT_ITERATE_FLAG_SORT_BY_VALUE)) == 0);
const char *path;
int ret;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
} else if (ret == 0) {
return TRUE;
int ret;
return ret;
static struct dict_transaction_context *
const char *key;
int ret = 0;
case DICT_CHANGE_TYPE_SET:
case DICT_CHANGE_TYPE_UNSET:
case DICT_CHANGE_TYPE_APPEND:
case DICT_CHANGE_TYPE_INC:
i_unreached();
if (ret < 0)
void *context)
int ret;
return ret;
NULL,
NULL,