Lines Matching refs:fs
12 #include "fs-api-private.h"
21 struct fs fs;
39 static struct fs *fs_dict_alloc(void)
41 struct dict_fs *fs;
43 fs = i_new(struct dict_fs, 1);
44 fs->fs = fs_class_dict;
45 return &fs->fs;
49 fs_dict_init(struct fs *_fs, const char *args, const struct fs_settings *set)
51 struct dict_fs *fs = (struct dict_fs *)_fs;
62 fs->encoding = FS_DICT_VALUE_ENCODING_RAW;
64 fs->encoding = FS_DICT_VALUE_ENCODING_HEX;
66 fs->encoding = FS_DICT_VALUE_ENCODING_BASE64;
76 if (dict_init(p, &dict_set, &fs->dict, &error) < 0) {
83 static void fs_dict_deinit(struct fs *_fs)
85 struct dict_fs *fs = (struct dict_fs *)_fs;
87 dict_deinit(&fs->dict);
88 i_free(fs);
91 static enum fs_properties fs_dict_get_properties(struct fs *fs ATTR_UNUSED)
101 pool = pool_alloconly_create("fs dict file", 128);
112 struct dict_fs *fs = (struct dict_fs *)_file->fs;
125 file->key = fs->path_prefix == NULL ?
127 p_strconcat(file->pool, fs->path_prefix, file->file.path, NULL);
148 struct dict_fs *fs = (struct dict_fs *)file->file.fs;
155 ret = dict_lookup(fs->dict, file->pool, file->key, &file->value, &error);
160 fs_set_error(&fs->fs, "dict_lookup(%s) failed: %s", file->key, error);
164 fs_set_error(&fs->fs, "Dict key %s doesn't exist", file->key);
176 input = i_stream_create_error_str(errno, "%s", fs_last_error(_file->fs));
196 struct dict_fs *fs = (struct dict_fs *)file->file.fs;
204 file->key = fs->path_prefix == NULL ? p_strdup(file->pool, new_fname) :
205 p_strconcat(file->pool, fs->path_prefix, new_fname, NULL);
211 struct dict_fs *fs = (struct dict_fs *)_file->fs;
220 trans = dict_transaction_begin(fs->dict);
221 switch (fs->encoding) {
243 fs_set_error(_file->fs, "Dict transaction commit failed: %s", error);
264 struct dict_fs *fs = (struct dict_fs *)_file->fs;
268 trans = dict_transaction_begin(fs->dict);
272 fs_set_error(_file->fs, "Dict transaction commit failed: %s", error);
289 struct dict_fs *fs = (struct dict_fs *)_iter->fs;
291 if (fs->path_prefix != NULL)
292 path = t_strconcat(fs->path_prefix, path, NULL);
294 iter->dict_iter = dict_iterate_init(fs->dict, path, 0);
315 fs_set_error(_iter->fs, "Dict iteration failed: %s", error);
320 const struct fs fs_class_dict = {