NeoMutt
2025-09-05-43-g177ed6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c
Go to the documentation of this file.
1
23
29
30
#include "config.h"
31
#include <stdbool.h>
32
#include <stddef.h>
33
#include "
config/lib.h
"
34
#include "
conn/lib.h
"
35
#include "
expando/lib.h
"
36
44
const
struct
ExpandoDefinition
NntpFormatDef
[] = {
45
// clang-format off
46
{
"a"
,
"account"
,
ED_NNTP
,
ED_NTP_ACCOUNT
, NULL },
47
{
"p"
,
"port"
,
ED_NNTP
,
ED_NTP_PORT
, NULL },
48
{
"P"
,
"port-if"
,
ED_NNTP
,
ED_NTP_PORT_IF
, NULL },
49
{
"s"
,
"server"
,
ED_NNTP
,
ED_NTP_SERVER
, NULL },
50
{
"S"
,
"schema"
,
ED_NNTP
,
ED_NTP_SCHEMA
, NULL },
51
{
"u"
,
"username"
,
ED_NNTP
,
ED_NTP_USERNAME
, NULL },
52
{ NULL, NULL, 0, -1, NULL }
53
// clang-format on
54
};
55
59
static
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
119
bool
config_init_nntp
(
struct
ConfigSet
*cs)
120
{
121
return
cs_register_variables
(cs,
NntpVars
);
122
}
lib.h
Convenience wrapper for the config headers.
cs_register_variables
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition
set.c:289
IP
#define IP
Definition
set.h:52
lib.h
Connection Library.
ED_NTP_SCHEMA
@ ED_NTP_SCHEMA
ConnAccount.account.
Definition
connaccount.h:85
ED_NTP_USERNAME
@ ED_NTP_USERNAME
ConnAccount.user.
Definition
connaccount.h:87
ED_NTP_PORT_IF
@ ED_NTP_PORT_IF
ConnAccount.port.
Definition
connaccount.h:84
ED_NTP_SERVER
@ ED_NTP_SERVER
ConnAccount.account.
Definition
connaccount.h:86
ED_NTP_ACCOUNT
@ ED_NTP_ACCOUNT
ConnAccount.account.
Definition
connaccount.h:82
ED_NTP_PORT
@ ED_NTP_PORT
ConnAccount.port.
Definition
connaccount.h:83
ED_NNTP
@ ED_NNTP
Nntp ED_NTP_ ExpandoDataNntp.
Definition
domain.h:49
lib.h
Parse Expando string.
charset_validator
int charset_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variables - Implements ConfigDef::validator() -.
Definition
charset.c:45
config_init_nntp
bool config_init_nntp(struct ConfigSet *cs)
Register nntp config variables - Implements module_init_config_t -.
Definition
config.c:119
NntpFormatDef
const struct ExpandoDefinition NntpFormatDef[]
Expando definitions.
Definition
config.c:44
NntpVars
static struct ConfigDef NntpVars[]
Config definitions for the NNTP library.
Definition
config.c:59
MUTT_ASKYES
@ MUTT_ASKYES
Ask the user, defaulting to 'Yes'.
Definition
quad.h:41
ConfigDef
Definition
set.h:62
ConfigSet
Container for lots of config items.
Definition
set.h:248
ExpandoDefinition
Definition of a format string.
Definition
definition.h:44
D_PATH_DIR
#define D_PATH_DIR
Path is a directory.
Definition
types.h:102
D_PATH_FILE
#define D_PATH_FILE
Path is a file.
Definition
types.h:103
DT_NUMBER
@ DT_NUMBER
a number
Definition
types.h:38
DT_BOOL
@ DT_BOOL
boolean option
Definition
types.h:32
DT_QUAD
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition
types.h:40
DT_STRING
@ DT_STRING
a string
Definition
types.h:44
DT_LONG
@ DT_LONG
a number (long)
Definition
types.h:35
DT_EXPANDO
@ DT_EXPANDO
an expando
Definition
types.h:34
DT_PATH
@ DT_PATH
a path to a file/directory
Definition
types.h:39
D_SENSITIVE
#define D_SENSITIVE
Contains sensitive value, e.g. password.
Definition
types.h:80
D_INTEGER_NOT_NEGATIVE
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition
types.h:100