NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mutt_config.c File Reference

Definitions of config variables. More...

#include "config.h"
#include <ctype.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "attach/lib.h"
#include "expando/lib.h"
#include "index/lib.h"
#include "menu/lib.h"
#include "init.h"
#include "mutt_logging.h"
#include "mutt_thread.h"
#include "mx.h"
+ Include dependency graph for mutt_config.c:

Go to the source code of this file.

Macros

#define CONFIG_INIT_TYPE(CS, NAME)
 
#define CONFIG_INIT_VARS(CS, NAME)
 

Functions

static int multipart_validator (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
 Validate the "show_multipart_alternative" config variable - Implements ConfigDef::validator() -.
 
struct ExpandoNodeparse_index_date_recv_local (const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_index_date_local (const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_index_date (const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_index_hook (const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
 Parse an index-hook - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_tags_transformed (const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
 Parse a Tags-Transformed Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_subject (const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
 Parse a Subject Expando - Implements ExpandoDefinition::parse() -.
 
static bool config_init_main (struct ConfigSet *cs)
 Register main config variables - Implements module_init_config_t -.
 
static void init_types (struct ConfigSet *cs)
 Create the config types.
 
static void init_variables (struct ConfigSet *cs)
 Define the config variables.
 
void init_config (struct ConfigSet *cs)
 Initialise the config system.
 

Variables

const struct ExpandoDefinition IndexFormatDef []
 Expando definitions.
 
static const struct Mapping SortAuxMethods []
 Sort methods for '$sort_aux' for the index.
 
const struct Mapping SortMethods []
 Sort methods for '$sort' for the index.
 
static const struct ExpandoDefinition AttachFormatDef []
 Expando definitions.
 
static const struct ExpandoDefinition *const IndexFormatDefNoPadding = &(IndexFormatDef[3])
 IndexFormatDefNoPadding - Index format definitions, without padding.
 
static const struct ExpandoDefinition StatusFormatDef []
 Expando definitions.
 
const struct ExpandoDefinition *const StatusFormatDefNoPadding = &(StatusFormatDef[3])
 StatusFormatDefNoPadding - Status format definitions, without padding.
 
static struct ConfigDef MainVars []
 General Config definitions for NeoMutt.
 
static struct ConfigDef MainVarsIdn []
 IDN Config definitions.
 

Detailed Description

Definitions of config variables.

Authors
  • Aditya De Saha
  • Louis Brauer
  • Pietro Cerutti
  • Richard Russon
  • Ashish Panigrahi
  • наб
  • Tóth János

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file mutt_config.c.

Macro Definition Documentation

◆ CONFIG_INIT_TYPE

#define CONFIG_INIT_TYPE (   CS,
  NAME 
)
Value:
extern const struct ConfigSetType Cst##NAME; \
cs_register_type(CS, &Cst##NAME)

Definition at line 56 of file mutt_config.c.

◆ CONFIG_INIT_VARS

#define CONFIG_INIT_VARS (   CS,
  NAME 
)
Value:
bool config_init_##NAME(struct ConfigSet *cs); \
config_init_##NAME(CS)
Container for lots of config items.
Definition: set.h:252

Definition at line 60 of file mutt_config.c.

Function Documentation

◆ init_types()

static void init_types ( struct ConfigSet cs)
static

Create the config types.

Parameters
csConfig items

Define the config types, e.g. DT_STRING.

Definition at line 973 of file mutt_config.c.

974{
976 CONFIG_INIT_TYPE(cs, Bool);
977 CONFIG_INIT_TYPE(cs, Enum);
979 CONFIG_INIT_TYPE(cs, Long);
980 CONFIG_INIT_TYPE(cs, Mbtable);
981 CONFIG_INIT_TYPE(cs, MyVar);
982 CONFIG_INIT_TYPE(cs, Number);
983 CONFIG_INIT_TYPE(cs, Path);
984 CONFIG_INIT_TYPE(cs, Quad);
987 CONFIG_INIT_TYPE(cs, Sort);
988 CONFIG_INIT_TYPE(cs, String);
989}
#define CONFIG_INIT_TYPE(CS, NAME)
Definition: mutt_config.c:56
An email address.
Definition: address.h:36
Parsed Expando trees.
Definition: expando.h:41
Cached regular expression.
Definition: regex3.h:86
String list.
Definition: slist.h:37
+ Here is the caller graph for this function:

◆ init_variables()

static void init_variables ( struct ConfigSet cs)
static

Define the config variables.

Parameters
csConfig items

Definition at line 995 of file mutt_config.c.

996{
997 // Define the config variables
999 CONFIG_INIT_VARS(cs, alias);
1000#if defined(USE_AUTOCRYPT)
1001 CONFIG_INIT_VARS(cs, autocrypt);
1002#endif
1003 CONFIG_INIT_VARS(cs, browser);
1004 CONFIG_INIT_VARS(cs, compose);
1005 CONFIG_INIT_VARS(cs, conn);
1006#if defined(USE_HCACHE)
1007 CONFIG_INIT_VARS(cs, hcache);
1008#endif
1009 CONFIG_INIT_VARS(cs, helpbar);
1010 CONFIG_INIT_VARS(cs, history);
1011 CONFIG_INIT_VARS(cs, imap);
1012 CONFIG_INIT_VARS(cs, index);
1013 CONFIG_INIT_VARS(cs, maildir);
1014 CONFIG_INIT_VARS(cs, mh);
1015 CONFIG_INIT_VARS(cs, mbox);
1016 CONFIG_INIT_VARS(cs, menu);
1017 CONFIG_INIT_VARS(cs, ncrypt);
1018 CONFIG_INIT_VARS(cs, nntp);
1019#if defined(USE_NOTMUCH)
1020 CONFIG_INIT_VARS(cs, notmuch);
1021#endif
1022 CONFIG_INIT_VARS(cs, pager);
1023 CONFIG_INIT_VARS(cs, pattern);
1024 CONFIG_INIT_VARS(cs, pop);
1026 CONFIG_INIT_VARS(cs, sidebar);
1027}
static bool config_init_main(struct ConfigSet *cs)
Register main config variables - Implements module_init_config_t -.
Definition: mutt_config.c:956
static bool send(struct Notify *source, struct Notify *current, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:120
#define CONFIG_INIT_VARS(CS, NAME)
Definition: mutt_config.c:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_config()

void init_config ( struct ConfigSet cs)

Initialise the config system.

Parameters
csConfig items

Definition at line 1033 of file mutt_config.c.

1034{
1035 init_types(cs);
1036 init_variables(cs);
1037}
static void init_types(struct ConfigSet *cs)
Create the config types.
Definition: mutt_config.c:973
static void init_variables(struct ConfigSet *cs)
Define the config variables.
Definition: mutt_config.c:995
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ IndexFormatDef

const struct ExpandoDefinition IndexFormatDef[]

Expando definitions.

Config:

  • $attribution_intro
  • $attribution_trailer
  • $forward_attribution_intro
  • $forward_attribution_trailer
  • $forward_format
  • $index_format
  • $message_format
  • $pager_format
Note
Longer Expandos must precede any similar, but shorter Expandos

Definition at line 313 of file mutt_config.c.

◆ SortAuxMethods

const struct Mapping SortAuxMethods[]
static
Initial value:
= {
{ "date", SORT_DATE },
{ "date-sent", SORT_DATE },
{ "threads", SORT_DATE },
{ "date-received", SORT_RECEIVED },
{ "from", SORT_FROM },
{ "label", SORT_LABEL },
{ "unsorted", SORT_ORDER },
{ "mailbox-order", SORT_ORDER },
{ "score", SORT_SCORE },
{ "size", SORT_SIZE },
{ "spam", SORT_SPAM },
{ "subject", SORT_SUBJECT },
{ "to", SORT_TO },
{ NULL, 0 },
}
@ SORT_SUBJECT
Sort by the email's subject.
Definition: sort2.h:38
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:40
@ SORT_SPAM
Sort by the email's spam score.
Definition: sort2.h:49
@ SORT_LABEL
Sort by the emails label.
Definition: sort2.h:54
@ SORT_FROM
Sort by the email's From field.
Definition: sort2.h:39
@ SORT_SIZE
Sort by the size of the email.
Definition: sort2.h:36
@ SORT_RECEIVED
Sort by when the message were delivered locally.
Definition: sort2.h:42
@ SORT_TO
Sort by the email's To field.
Definition: sort2.h:43
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:35
@ SORT_SCORE
Sort by the email's score.
Definition: sort2.h:44

Sort methods for '$sort_aux' for the index.

Definition at line 67 of file mutt_config.c.

◆ SortMethods

const struct Mapping SortMethods[]
Initial value:
= {
{ "date", SORT_DATE },
{ "date-sent", SORT_DATE },
{ "date-received", SORT_RECEIVED },
{ "from", SORT_FROM },
{ "label", SORT_LABEL },
{ "unsorted", SORT_ORDER },
{ "mailbox-order", SORT_ORDER },
{ "score", SORT_SCORE },
{ "size", SORT_SIZE },
{ "spam", SORT_SPAM },
{ "subject", SORT_SUBJECT },
{ "threads", SORT_THREADS },
{ "to", SORT_TO },
{ NULL, 0 },
}
@ SORT_THREADS
Sort by email threads.
Definition: sort2.h:41

Sort methods for '$sort' for the index.

Definition at line 89 of file mutt_config.c.

◆ AttachFormatDef

const struct ExpandoDefinition AttachFormatDef[]
static
Initial value:
= {
{ "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
{ ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
{ "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
{ "c", "charset-convert", ED_BODY, ED_BOD_CHARSET_CONVERT, NULL },
{ "C", "charset", ED_ATTACH, ED_ATT_CHARSET, NULL },
{ "d", "description", ED_BODY, ED_BOD_DESCRIPTION, NULL },
{ "D", "deleted", ED_BODY, ED_BOD_DELETED, NULL },
{ "e", "mime-encoding", ED_BODY, ED_BOD_MIME_ENCODING, NULL },
{ "f", "file", ED_BODY, ED_BOD_FILE, NULL },
{ "F", "file-disposition", ED_BODY, ED_BOD_FILE_DISPOSITION, NULL },
{ "I", "disposition", ED_BODY, ED_BOD_DISPOSITION, NULL },
{ "m", "mime-major", ED_BODY, ED_BOD_MIME_MAJOR, NULL },
{ "M", "mime-minor", ED_BODY, ED_BOD_MIME_MINOR, NULL },
{ "n", "number", ED_ATTACH, ED_ATT_NUMBER, NULL },
{ "Q", "attach-qualifies", ED_BODY, ED_BOD_ATTACH_QUALIFIES, NULL },
{ "s", "file-size", ED_BODY, ED_BOD_FILE_SIZE, NULL },
{ "t", "tagged", ED_BODY, ED_BOD_TAGGED, NULL },
{ "T", "tree", ED_ATTACH, ED_ATT_TREE, NULL },
{ "u", "unlink", ED_BODY, ED_BOD_UNLINK, NULL },
{ "X", "attach-count", ED_BODY, ED_BOD_ATTACH_COUNT, NULL },
{ NULL, NULL, 0, -1, NULL }
}
@ ED_ATT_NUMBER
AttachPtr.num.
Definition: attach.h:57
@ ED_ATT_TREE
AttachPtr.tree.
Definition: attach.h:58
@ ED_ATT_CHARSET
AttachPtr.body.
Definition: attach.h:56
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
@ ED_BODY
Body ED_BOD_ ExpandoDataBody.
Definition: domain.h:38
@ ED_ATTACH
Attach ED_ATT_ ExpandoDataAttach.
Definition: domain.h:36
@ ED_BOD_DESCRIPTION
Body.description.
Definition: body.h:106
@ ED_BOD_CHARSET_CONVERT
Body.type.
Definition: body.h:104
@ ED_BOD_DELETED
Body.deleted.
Definition: body.h:105
@ ED_BOD_UNLINK
Body.unlink.
Definition: body.h:115
@ ED_BOD_FILE_SIZE
Body.filename.
Definition: body.h:110
@ ED_BOD_DISPOSITION
Body.disposition.
Definition: body.h:107
@ ED_BOD_ATTACH_QUALIFIES
Body.attach_qualifies.
Definition: body.h:103
@ ED_BOD_MIME_MAJOR
Body.type, Body.xtype.
Definition: body.h:112
@ ED_BOD_TAGGED
Body.tagged.
Definition: body.h:114
@ ED_BOD_ATTACH_COUNT
Body.attach_count.
Definition: body.h:102
@ ED_BOD_FILE
Body.filename.
Definition: body.h:108
@ ED_BOD_MIME_MINOR
Body.subtype.
Definition: body.h:113
@ ED_BOD_FILE_DISPOSITION
Body.d_filename.
Definition: body.h:109
@ ED_BOD_MIME_ENCODING
Body.encoding.
Definition: body.h:111
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
@ 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

Expando definitions.

Config:

  • $attach_format

Definition at line 132 of file mutt_config.c.

◆ IndexFormatDefNoPadding

const struct ExpandoDefinition* const IndexFormatDefNoPadding = &(IndexFormatDef[3])
static

IndexFormatDefNoPadding - Index format definitions, without padding.

Definition at line 374 of file mutt_config.c.

◆ StatusFormatDef

const struct ExpandoDefinition StatusFormatDef[]
static

Expando definitions.

Config:

  • $new_mail_command
  • $status_format
  • $ts_icon_format
  • $ts_status_format

Definition at line 385 of file mutt_config.c.

◆ StatusFormatDefNoPadding

const struct ExpandoDefinition* const StatusFormatDefNoPadding = &(StatusFormatDef[3])

StatusFormatDefNoPadding - Status format definitions, without padding.

Definition at line 418 of file mutt_config.c.

◆ MainVars

struct ConfigDef MainVars[]
static

General Config definitions for NeoMutt.

Definition at line 423 of file mutt_config.c.

◆ MainVarsIdn

struct ConfigDef MainVarsIdn[]
static
Initial value:
= {
{ "idn_decode", DT_BOOL, true, 0, NULL,
"(idn) Decode international domain names"
},
{ "idn_encode", DT_BOOL, true, 0, NULL,
"(idn) Encode international domain names"
},
{ NULL },
}
@ DT_BOOL
boolean option
Definition: types.h:32

IDN Config definitions.

Definition at line 940 of file mutt_config.c.