NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stdbool.h>
31#include <stddef.h>
32#include "private.h"
33#include "config/lib.h"
34#include "expando/lib.h"
35
36// clang-format off
37char *AutocryptSignAs = NULL;
38char *AutocryptDefaultKey = NULL;
39// clang-format on
40
47static const struct ExpandoDefinition AutocryptFormatDef[] = {
48 // clang-format off
49 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
50 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
51 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
52 { "a", "address", ED_AUTOCRYPT, ED_AUT_ADDRESS, NULL },
53 { "k", "keyid", ED_AUTOCRYPT, ED_AUT_KEYID, NULL },
54 { "n", "number", ED_AUTOCRYPT, ED_AUT_NUMBER, NULL },
55 { "p", "prefer-encrypt", ED_AUTOCRYPT, ED_AUT_PREFER_ENCRYPT, NULL },
56 { "s", "enabled", ED_AUTOCRYPT, ED_AUT_ENABLED, NULL },
57 { NULL, NULL, 0, -1, NULL }
58 // clang-format on
59};
60
64static struct ConfigDef AutocryptVars[] = {
65 // clang-format off
66 { "autocrypt", DT_BOOL, false, 0, NULL,
67 "Enables the Autocrypt feature"
68 },
69 { "autocrypt_acct_format", DT_EXPANDO, IP "%4n %-30a %20p %10s", IP &AutocryptFormatDef, NULL,
70 "Format of the autocrypt account menu"
71 },
72 { "autocrypt_dir", DT_PATH|D_PATH_DIR, IP "~/.mutt/autocrypt", 0, NULL,
73 "Location of autocrypt files, including the GPG keyring and SQLite database"
74 },
75 { "autocrypt_reply", DT_BOOL, true, 0, NULL,
76 "Replying to an autocrypt email automatically enables autocrypt in the reply"
77 },
78 { NULL },
79 // clang-format on
80};
81
86{
87 bool rc = false;
88
89#if defined(USE_AUTOCRYPT)
91#endif
92
93 return rc;
94}
char * AutocryptSignAs
Autocrypt Key id to sign as.
Definition: config.c:37
static const struct ExpandoDefinition AutocryptFormatDef[]
Expando definitions.
Definition: config.c:47
char * AutocryptDefaultKey
Autocrypt default key id (used for postponing messages)
Definition: config.c:38
static struct ConfigDef AutocryptVars[]
Config definitions for the autocrypt library.
Definition: config.c:64
@ ED_AUT_ADDRESS
AccountEntry.addr.
Definition: private.h:63
@ ED_AUT_KEYID
AutocryptAccount.keyid.
Definition: private.h:62
@ ED_AUT_NUMBER
AccountEntry.num.
Definition: private.h:64
@ ED_AUT_ENABLED
AutocryptAccount.enabled.
Definition: private.h:61
@ ED_AUT_PREFER_ENCRYPT
AutocryptAccount.prefer_encrypt.
Definition: private.h:65
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition: set.c:281
#define IP
Definition: set.h:54
@ ED_AUTOCRYPT
Autocrypt ED_AUT_ ExpandoDataAutocrypt.
Definition: domain.h:37
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
Parse Expando string.
bool config_init_autocrypt(struct ConfigSet *cs)
Register autocrypt config variables - Implements module_init_config_t -.
Definition: config.c:85
struct ExpandoNode * node_padding_parse(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:234
GUI display the mailboxes in a side panel.
Definition: set.h:64
Container for lots of config items.
Definition: set.h:252
Definition of a format string.
Definition: definition.h:44
#define D_PATH_DIR
Path is a directory.
Definition: types.h:103
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_EXPANDO
an expando
Definition: types.h:34
@ DT_PATH
a path to a file/directory
Definition: types.h:40
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:36
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:37
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:38