annotate src/dict/dict-settings.c @ 9545:ee99bb70b05f HEAD

dict proxy: Use base_dir as the default dict-server location.
author Timo Sirainen <tss@iki.fi>
date Sat, 27 Jun 2009 22:08:48 -0400
parents aa08a4506d89
children 5a25b4ec5694
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9149
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 /* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3 #include "lib.h"
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include "settings-parser.h"
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 #include "dict-settings.h"
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 #undef DEF
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 #define DEF(type, name) \
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 { type, #name, offsetof(struct dict_settings, name), NULL }
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 static struct setting_define dict_setting_defines[] = {
9545
ee99bb70b05f dict proxy: Use base_dir as the default dict-server location.
Timo Sirainen <tss@iki.fi>
parents: 9405
diff changeset
12 DEF(SET_STR, base_dir),
9149
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 DEF(SET_STR, dict_db_config),
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14 { SET_STRLIST, "dict", offsetof(struct dict_settings, dicts), NULL },
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 SETTING_DEFINE_LIST_END
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 };
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 struct dict_settings dict_default_settings = {
9545
ee99bb70b05f dict proxy: Use base_dir as the default dict-server location.
Timo Sirainen <tss@iki.fi>
parents: 9405
diff changeset
20 MEMBER(base_dir) PKG_RUNDIR,
9149
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 MEMBER(dict_db_config) "",
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22 MEMBER(dicts) ARRAY_INIT
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 };
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 struct setting_parser_info dict_setting_parser_info = {
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26 MEMBER(defines) dict_setting_defines,
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
27 MEMBER(defaults) &dict_default_settings,
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29 MEMBER(parent) NULL,
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30 MEMBER(dynamic_parsers) NULL,
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
31
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32 MEMBER(parent_offset) (size_t)-1,
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
33 MEMBER(type_offset) (size_t)-1,
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
34 MEMBER(struct_size) sizeof(struct dict_settings)
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
35 };
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
36
6d374fc3ae1d Moved most of the dict settings handling to dict binary.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 struct dict_settings *dict_settings;