NeoMutt  2024-04-16-36-g75b6fb
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stddef.h>
32#include <stdbool.h>
33#include "config/lib.h"
34#include "conn/lib.h"
35#include "expando/lib.h"
36
45 // clang-format off
46 { "a", "account", ED_NNTP, ED_NTP_ACCOUNT, E_TYPE_STRING, NULL },
47 { "p", "port", ED_NNTP, ED_NTP_PORT, E_TYPE_NUMBER, NULL },
48 { "P", "port-if", ED_NNTP, ED_NTP_PORT_IF, E_TYPE_NUMBER, NULL },
49 { "s", "server", ED_NNTP, ED_NTP_SERVER, E_TYPE_STRING, NULL },
50 { "S", "schema", ED_NNTP, ED_NTP_SCHEMA, E_TYPE_STRING, NULL },
51 { "u", "username", ED_NNTP, ED_NTP_USERNAME, E_TYPE_STRING, NULL },
52 { NULL, NULL, 0, -1, -1, NULL }
53 // clang-format on
54};
55
59static struct ConfigDef NntpVars[] = {
60 // clang-format off
61 { "catchup_newsgroup", DT_QUAD, MUTT_ASKYES, 0, NULL,
62 "(nntp) Mark all articles as read when leaving a newsgroup"
63 },
64 { "followup_to_poster", DT_QUAD, MUTT_ASKYES, 0, NULL,
65 "(nntp) Reply to the poster if 'poster' is in the 'Followup-To' header"
66 },
67 { "newsgroups_charset", DT_STRING, IP "utf-8", 0, charset_validator,
68 "(nntp) Character set of newsgroups' descriptions"
69 },
70 { "newsrc", DT_EXPANDO|D_PATH_FILE, IP "~/.newsrc", IP &NntpFormatDef, NULL,
71 "(nntp) File containing list of subscribed newsgroups"
72 },
73 { "news_cache_dir", DT_PATH|D_PATH_DIR, IP "~/.neomutt", 0, NULL,
74 "(nntp) Directory for cached news articles"
75 },
76 { "news_server", DT_STRING, 0, 0, NULL,
77 "(nntp) Url of the news server"
78 },
79 { "nntp_authenticators", DT_STRING, 0, 0, NULL,
80 "(nntp) Allowed authentication methods"
81 },
82 { "nntp_context", DT_LONG|D_INTEGER_NOT_NEGATIVE, 1000, 0, NULL,
83 "(nntp) Maximum number of articles to list (0 for all articles)"
84 },
85 { "nntp_listgroup", DT_BOOL, true, 0, NULL,
86 "(nntp) Check all articles when opening a newsgroup"
87 },
88 { "nntp_load_description", DT_BOOL, true, 0, NULL,
89 "(nntp) Load descriptions for newsgroups when adding to the list"
90 },
91 { "nntp_pass", DT_STRING|D_SENSITIVE, 0, 0, NULL,
92 "(nntp) Password for the news server"
93 },
94 { "nntp_poll", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 60, 0, NULL,
95 "(nntp) Interval between checks for new posts"
96 },
97 { "nntp_user", DT_STRING|D_SENSITIVE, 0, 0, NULL,
98 "(nntp) Username for the news server"
99 },
100 { "post_moderated", DT_QUAD, MUTT_ASKYES, 0, NULL,
101 "(nntp) Allow posting to moderated newsgroups"
102 },
103 { "save_unsubscribed", DT_BOOL, false, 0, NULL,
104 "(nntp) Save a list of unsubscribed newsgroups to the 'newsrc'"
105 },
106 { "show_new_news", DT_BOOL, true, 0, NULL,
107 "(nntp) Check for new newsgroups when entering the browser"
108 },
109 { "x_comment_to", DT_BOOL, false, 0, NULL,
110 "(nntp) Add 'X-Comment-To' header that contains article author"
111 },
112 { NULL },
113 // clang-format on
114};
115
120{
122}
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
Connection Library.
@ ED_NTP_SCHEMA
ConnAccount.account.
Definition: connaccount.h:85
@ ED_NTP_USERNAME
ConnAccount.user.
Definition: connaccount.h:87
@ ED_NTP_PORT_IF
ConnAccount.port.
Definition: connaccount.h:84
@ ED_NTP_SERVER
ConnAccount.account.
Definition: connaccount.h:86
@ ED_NTP_ACCOUNT
ConnAccount.account.
Definition: connaccount.h:82
@ ED_NTP_PORT
ConnAccount.port.
Definition: connaccount.h:83
@ E_TYPE_STRING
Data is a string.
Definition: definition.h:37
@ E_TYPE_NUMBER
Data is numeric.
Definition: definition.h:38
@ ED_NNTP
Nntp ED_NTP_ ExpandoDataNntp.
Definition: domain.h:50
Parse Expando string.
int charset_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variables - Implements ConfigDef::validator() -.
Definition: charset.c:45
bool config_init_nntp(struct ConfigSet *cs)
Register nntp config variables - Implements module_init_config_t -.
Definition: config.c:119
const struct ExpandoDefinition NntpFormatDef[]
Expando definitions.
Definition: config.c:44
static struct ConfigDef NntpVars[]
Config definitions for the NNTP library.
Definition: config.c:59
@ MUTT_ASKYES
Ask the user, defaulting to 'Yes'.
Definition: quad.h:41
Definition: set.h:64
Container for lots of config items.
Definition: set.h:252
Definition of a format string.
Definition: definition.h:52
#define D_PATH_DIR
Path is a directory.
Definition: types.h:103
#define D_PATH_FILE
Path is a file.
Definition: types.h:104
@ DT_NUMBER
a number
Definition: types.h:39
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:41
@ DT_STRING
a string
Definition: types.h:45
@ DT_LONG
a number (long)
Definition: types.h:36
@ DT_EXPANDO
an expando
Definition: types.h:34
@ DT_PATH
a path to a file/directory
Definition: types.h:40
#define D_SENSITIVE
Contains sensitive value, e.g. password.
Definition: types.h:81
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:101