NeoMutt  2024-10-02-37-gfa9146
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 <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, 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, 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, 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, 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, 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, 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 55 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 59 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 961 of file mutt_config.c.

962{
964 CONFIG_INIT_TYPE(cs, Bool);
965 CONFIG_INIT_TYPE(cs, Enum);
967 CONFIG_INIT_TYPE(cs, Long);
968 CONFIG_INIT_TYPE(cs, Mbtable);
969 CONFIG_INIT_TYPE(cs, MyVar);
970 CONFIG_INIT_TYPE(cs, Number);
971 CONFIG_INIT_TYPE(cs, Path);
972 CONFIG_INIT_TYPE(cs, Quad);
975 CONFIG_INIT_TYPE(cs, Sort);
976 CONFIG_INIT_TYPE(cs, String);
977}
#define CONFIG_INIT_TYPE(CS, NAME)
Definition: mutt_config.c:55
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 983 of file mutt_config.c.

984{
985 // Define the config variables
987 CONFIG_INIT_VARS(cs, alias);
988#if defined(USE_AUTOCRYPT)
989 CONFIG_INIT_VARS(cs, autocrypt);
990#endif
991 CONFIG_INIT_VARS(cs, browser);
992 CONFIG_INIT_VARS(cs, compose);
993 CONFIG_INIT_VARS(cs, conn);
994#if defined(USE_HCACHE)
995 CONFIG_INIT_VARS(cs, hcache);
996#endif
997 CONFIG_INIT_VARS(cs, helpbar);
998 CONFIG_INIT_VARS(cs, history);
999 CONFIG_INIT_VARS(cs, imap);
1000 CONFIG_INIT_VARS(cs, index);
1001 CONFIG_INIT_VARS(cs, maildir);
1002 CONFIG_INIT_VARS(cs, mh);
1003 CONFIG_INIT_VARS(cs, mbox);
1004 CONFIG_INIT_VARS(cs, menu);
1005 CONFIG_INIT_VARS(cs, ncrypt);
1006 CONFIG_INIT_VARS(cs, nntp);
1007#if defined(USE_NOTMUCH)
1008 CONFIG_INIT_VARS(cs, notmuch);
1009#endif
1010 CONFIG_INIT_VARS(cs, pager);
1011 CONFIG_INIT_VARS(cs, pattern);
1012 CONFIG_INIT_VARS(cs, pop);
1014 CONFIG_INIT_VARS(cs, sidebar);
1015}
static bool config_init_main(struct ConfigSet *cs)
Register main config variables - Implements module_init_config_t -.
Definition: mutt_config.c:944
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:59
+ 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 1021 of file mutt_config.c.

1022{
1023 init_types(cs);
1024 init_variables(cs);
1025}
static void init_types(struct ConfigSet *cs)
Create the config types.
Definition: mutt_config.c:961
static void init_variables(struct ConfigSet *cs)
Define the config variables.
Definition: mutt_config.c:983
+ 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 301 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 66 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 88 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: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, 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 131 of file mutt_config.c.

◆ IndexFormatDefNoPadding

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

IndexFormatDefNoPadding - Index format definitions, without padding.

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

◆ StatusFormatDefNoPadding

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

StatusFormatDefNoPadding - Status format definitions, without padding.

Definition at line 406 of file mutt_config.c.

◆ MainVars

struct ConfigDef MainVars[]
static

General Config definitions for NeoMutt.

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