NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
config.c
Go to the documentation of this file.
1 
29 #include "config.h"
30 #include <stddef.h>
31 #include <config/lib.h>
32 #include <stdbool.h>
33 
34 static struct ConfigDef NntpVars[] = {
35  // clang-format off
36  { "catchup_newsgroup", DT_QUAD, MUTT_ASKYES, 0, NULL,
37  "(nntp) Mark all articles as read when leaving a newsgroup"
38  },
39  { "followup_to_poster", DT_QUAD, MUTT_ASKYES, 0, NULL,
40  "(nntp) Reply to the poster if 'poster' is in the 'Followup-To' header"
41  },
42  { "group_index_format", DT_STRING|DT_NOT_EMPTY|R_INDEX|R_PAGER, IP "%4C %M%N %5s %-45.45f %d", 0, NULL,
43  "(nntp) printf-like format string for the browser's display of newsgroups"
44  },
45  { "newsgroups_charset", DT_STRING, IP "utf-8", 0, charset_validator,
46  "(nntp) Character set of newsgroups' descriptions"
47  },
48  { "newsrc", DT_PATH|DT_PATH_FILE, IP "~/.newsrc", 0, NULL,
49  "(nntp) File containing list of subscribed newsgroups"
50  },
51  { "news_cache_dir", DT_PATH|DT_PATH_DIR, IP "~/.neomutt", 0, NULL,
52  "(nntp) Directory for cached news articles"
53  },
54  { "news_server", DT_STRING, 0, 0, NULL,
55  "(nntp) Url of the news server"
56  },
57  { "nntp_authenticators", DT_STRING, 0, 0, NULL,
58  "(nntp) Allowed authentication methods"
59  },
60  { "nntp_context", DT_NUMBER|DT_NOT_NEGATIVE, 1000, 0, NULL,
61  "(nntp) Maximum number of articles to list (0 for all articles)"
62  },
63  { "nntp_listgroup", DT_BOOL, true, 0, NULL,
64  "(nntp) Check all articles when opening a newsgroup"
65  },
66  { "nntp_load_description", DT_BOOL, true, 0, NULL,
67  "(nntp) Load descriptions for newsgroups when adding to the list"
68  },
69  { "nntp_pass", DT_STRING|DT_SENSITIVE, 0, 0, NULL,
70  "(nntp) Password for the news server"
71  },
72  { "nntp_poll", DT_NUMBER|DT_NOT_NEGATIVE, 60, 0, NULL,
73  "(nntp) Interval between checks for new posts"
74  },
75  { "nntp_user", DT_STRING|DT_SENSITIVE, 0, 0, NULL,
76  "(nntp) Username for the news server"
77  },
78  { "post_moderated", DT_QUAD, MUTT_ASKYES, 0, NULL,
79  "(nntp) Allow posting to moderated newsgroups"
80  },
81  { "save_unsubscribed", DT_BOOL, false, 0, NULL,
82  "(nntp) Save a list of unsubscribed newsgroups to the 'newsrc'"
83  },
84  { "show_new_news", DT_BOOL, true, 0, NULL,
85  "(nntp) Check for new newsgroups when entering the browser"
86  },
87  { "show_only_unread", DT_BOOL, false, 0, NULL,
88  "(nntp) Only show subscribed newsgroups with unread articles"
89  },
90  { "x_comment_to", DT_BOOL, false, 0, NULL,
91  "(nntp) Add 'X-Comment-To' header that contains article author"
92  },
93  { NULL },
94  // clang-format on
95 };
96 
100 bool config_init_nntp(struct ConfigSet *cs)
101 {
102  return cs_register_variables(cs, NntpVars, 0);
103 }
#define R_PAGER
Redraw the pager menu.
Definition: types.h:66
Container for lots of config items.
Definition: set.h:259
#define IP
Definition: set.h:54
#define DT_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:46
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Definition: set.h:63
#define DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:37
#define DT_SENSITIVE
Contains sensitive value, e.g. password.
Definition: types.h:49
Convenience wrapper for the config headers.
#define DT_PATH_DIR
Path is a directory.
Definition: types.h:53
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], uint32_t flags)
Register a set of config items.
Definition: set.c:276
#define DT_PATH_FILE
Path is a file.
Definition: types.h:54
int charset_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variable - Implements ConfigDef::validator() -.
Definition: charset.c:39
#define DT_STRING
a string
Definition: types.h:41
#define DT_PATH
a path to a file/directory
Definition: types.h:36
Ask the user, defaulting to &#39;Yes&#39;.
Definition: quad.h:41
bool config_init_nntp(struct ConfigSet *cs)
Register nntp config variables - Implements module_init_config_t -.
Definition: config.c:100
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30
#define R_INDEX
Redraw the index menu (MENU_MAIN)
Definition: types.h:65