NeoMutt  2024-04-16-36-g75b6fb
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 <stddef.h>
#include <stdbool.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 "mixmaster/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)
 
#define MIXMASTER_DEFAULT   MIXMASTER
 

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, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_index_date_local (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_index_date (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse a Date Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_index_hook (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse an index-hook - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_tags_transformed (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 Parse a Tags-Transformed Expando - Implements ExpandoDefinition::parse() -.
 
struct ExpandoNodeparse_subject (const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
 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 const struct ExpandoDefinition MixFormatDef []
 Expando definitions.
 
static struct ConfigDef MainVarsMixmaster []
 Config definitions for the Mixmaster library.
 
static struct ConfigDef MainVarsIdn []
 IDN Config definitions for the Mixmaster library.
 

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.

◆ MIXMASTER_DEFAULT

#define MIXMASTER_DEFAULT   MIXMASTER

Definition at line 914 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 995 of file mutt_config.c.

996{
998 CONFIG_INIT_TYPE(cs, Bool);
999 CONFIG_INIT_TYPE(cs, Enum);
1001 CONFIG_INIT_TYPE(cs, Long);
1002 CONFIG_INIT_TYPE(cs, Mbtable);
1003 CONFIG_INIT_TYPE(cs, MyVar);
1004 CONFIG_INIT_TYPE(cs, Number);
1005 CONFIG_INIT_TYPE(cs, Path);
1006 CONFIG_INIT_TYPE(cs, Quad);
1009 CONFIG_INIT_TYPE(cs, Sort);
1010 CONFIG_INIT_TYPE(cs, String);
1011}
#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:85
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 1017 of file mutt_config.c.

1018{
1019 // Define the config variables
1020 config_init_main(cs);
1021 CONFIG_INIT_VARS(cs, alias);
1022#if defined(USE_AUTOCRYPT)
1023 CONFIG_INIT_VARS(cs, autocrypt);
1024#endif
1025 CONFIG_INIT_VARS(cs, browser);
1026 CONFIG_INIT_VARS(cs, compose);
1027 CONFIG_INIT_VARS(cs, conn);
1028#if defined(USE_HCACHE)
1029 CONFIG_INIT_VARS(cs, hcache);
1030#endif
1031 CONFIG_INIT_VARS(cs, helpbar);
1032 CONFIG_INIT_VARS(cs, history);
1033 CONFIG_INIT_VARS(cs, imap);
1034 CONFIG_INIT_VARS(cs, index);
1035 CONFIG_INIT_VARS(cs, maildir);
1036 CONFIG_INIT_VARS(cs, mh);
1037 CONFIG_INIT_VARS(cs, mbox);
1038 CONFIG_INIT_VARS(cs, menu);
1039 CONFIG_INIT_VARS(cs, ncrypt);
1040 CONFIG_INIT_VARS(cs, nntp);
1041#if defined(USE_NOTMUCH)
1042 CONFIG_INIT_VARS(cs, notmuch);
1043#endif
1044 CONFIG_INIT_VARS(cs, pager);
1045 CONFIG_INIT_VARS(cs, pattern);
1046 CONFIG_INIT_VARS(cs, pop);
1048 CONFIG_INIT_VARS(cs, sidebar);
1049}
static bool config_init_main(struct ConfigSet *cs)
Register main config variables - Implements module_init_config_t -.
Definition: mutt_config.c:974
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 1055 of file mutt_config.c.

1056{
1057 init_types(cs);
1058 init_variables(cs);
1059}
static void init_types(struct ConfigSet *cs)
Create the config types.
Definition: mutt_config.c:995
static void init_variables(struct ConfigSet *cs)
Define the config variables.
Definition: mutt_config.c:1017
+ 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

Definition at line 295 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:
= {
{ "c", "charset-convert", ED_BODY, ED_BOD_CHARSET_CONVERT, E_TYPE_STRING, NULL },
{ "C", "charset", ED_ATTACH, ED_ATT_CHARSET, E_TYPE_STRING, NULL },
{ "d", "description", ED_BODY, ED_BOD_DESCRIPTION, E_TYPE_STRING, NULL },
{ "D", "deleted", ED_BODY, ED_BOD_DELETED, E_TYPE_STRING, NULL },
{ "e", "mime-encoding", ED_BODY, ED_BOD_MIME_ENCODING, E_TYPE_STRING, NULL },
{ "f", "file", ED_BODY, ED_BOD_FILE, E_TYPE_STRING, NULL },
{ "F", "file-disposition", ED_BODY, ED_BOD_FILE_DISPOSITION, E_TYPE_STRING, NULL },
{ "I", "disposition", ED_BODY, ED_BOD_DISPOSITION, E_TYPE_STRING, NULL },
{ "m", "mime-major", ED_BODY, ED_BOD_MIME_MAJOR, E_TYPE_STRING, NULL },
{ "M", "mime-minor", ED_BODY, ED_BOD_MIME_MINOR, E_TYPE_STRING, NULL },
{ "n", "number", ED_ATTACH, ED_ATT_NUMBER, E_TYPE_NUMBER, NULL },
{ "Q", "attach-qualifies", ED_BODY, ED_BOD_ATTACH_QUALIFIES, E_TYPE_NUMBER, NULL },
{ "s", "file-size", ED_BODY, ED_BOD_FILE_SIZE, E_TYPE_NUMBER, NULL },
{ "t", "tagged", ED_BODY, ED_BOD_TAGGED, E_TYPE_STRING, NULL },
{ "T", "tree", ED_ATTACH, ED_ATT_TREE, E_TYPE_STRING, NULL },
{ "u", "unlink", ED_BODY, ED_BOD_UNLINK, E_TYPE_STRING, NULL },
{ "X", "attach-count", ED_BODY, ED_BOD_ATTACH_COUNT, E_TYPE_NUMBER, NULL },
{ NULL, NULL, 0, -1, -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
@ E_TYPE_STRING
Data is a string.
Definition: definition.h:37
@ E_TYPE_NUMBER
Data is numeric.
Definition: definition.h:38
@ 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:105
@ ED_BOD_CHARSET_CONVERT
Body.type.
Definition: body.h:103
@ ED_BOD_DELETED
Body.deleted.
Definition: body.h:104
@ ED_BOD_UNLINK
Body.unlink.
Definition: body.h:114
@ ED_BOD_FILE_SIZE
Body.filename.
Definition: body.h:109
@ ED_BOD_DISPOSITION
Body.disposition.
Definition: body.h:106
@ ED_BOD_ATTACH_QUALIFIES
Body.attach_qualifies.
Definition: body.h:102
@ ED_BOD_MIME_MAJOR
Body.type, Body.xtype.
Definition: body.h:111
@ ED_BOD_TAGGED
Body.tagged.
Definition: body.h:113
@ ED_BOD_ATTACH_COUNT
Body.attach_count.
Definition: body.h:101
@ ED_BOD_FILE
Body.filename.
Definition: body.h:107
@ ED_BOD_MIME_MINOR
Body.subtype.
Definition: body.h:112
@ ED_BOD_FILE_DISPOSITION
Body.d_filename.
Definition: body.h:108
@ ED_BOD_MIME_ENCODING
Body.encoding.
Definition: body.h:110
struct ExpandoNode * node_padding_parse(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:232
@ 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 356 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 367 of file mutt_config.c.

◆ StatusFormatDefNoPadding

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

StatusFormatDefNoPadding - Status format definitions, without padding.

Definition at line 400 of file mutt_config.c.

◆ MainVars

struct ConfigDef MainVars[]
static

General Config definitions for NeoMutt.

Definition at line 405 of file mutt_config.c.

◆ MixFormatDef

const struct ExpandoDefinition MixFormatDef[]
static
Initial value:
= {
{ "a", "address", ED_MIXMASTER, ED_MIX_ADDRESS, E_TYPE_STRING, NULL },
{ "c", "capabilities", ED_MIXMASTER, ED_MIX_CAPABILITIES, E_TYPE_STRING, NULL },
{ "n", "number", ED_MIXMASTER, ED_MIX_NUMBER, E_TYPE_NUMBER, NULL },
{ "s", "short-name", ED_MIXMASTER, ED_MIX_SHORT_NAME, E_TYPE_STRING, NULL },
{ NULL, NULL, 0, -1, -1, NULL }
}
@ ED_MIXMASTER
Mixmaster ED_MIX_ ExpandoDataMixmaster.
Definition: domain.h:49
@ ED_MIX_ADDRESS
Remailer.addr.
Definition: remailer.h:56
@ ED_MIX_CAPABILITIES
Remailer, mix_format_caps()
Definition: remailer.h:57
@ ED_MIX_SHORT_NAME
Remailer.shortname.
Definition: remailer.h:59
@ ED_MIX_NUMBER
Remailer.num.
Definition: remailer.h:58

Expando definitions.

Config:

  • $mix_entry_format

Definition at line 925 of file mutt_config.c.

◆ MainVarsMixmaster

struct ConfigDef MainVarsMixmaster[]
static
Initial value:
= {
{ "mix_entry_format", DT_EXPANDO|D_NOT_EMPTY, IP "%4n %c %-16s %a", IP &MixFormatDef, NULL,
"(mixmaster) printf-like format string for the mixmaster chain"
},
{ "mixmaster", DT_STRING|D_STRING_COMMAND, IP MIXMASTER_DEFAULT, 0, NULL,
"(mixmaster) External command to route a mixmaster message"
},
{ NULL },
}
#define IP
Definition: set.h:54
static const struct ExpandoDefinition MixFormatDef[]
Expando definitions.
Definition: mutt_config.c:925
#define MIXMASTER_DEFAULT
Definition: mutt_config.c:914
#define D_STRING_COMMAND
A command.
Definition: types.h:99
@ DT_STRING
a string
Definition: types.h:45
@ DT_EXPANDO
an expando
Definition: types.h:34
#define D_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:80

Config definitions for the Mixmaster library.

Definition at line 941 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 for the Mixmaster library.

Definition at line 958 of file mutt_config.c.