NeoMutt  2024-03-23-147-g885fbc
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
init.h File Reference

Config/command parsing. More...

#include <stdbool.h>
+ Include dependency graph for init.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void init_config (struct ConfigSet *cs)
 Initialise the config system.
 
int mutt_init (struct ConfigSet *cs, const char *dlevel, const char *dfile, bool skip_sys_rc, struct ListHead *commands)
 Initialise NeoMutt.
 
void mutt_opts_cleanup (void)
 Clean up before quitting.
 
int mutt_query_variables (struct ListHead *queries, bool show_docs)
 Implement the -Q command line flag.
 

Detailed Description

Config/command parsing.

Authors
  • Michael R. Elkins
  • g10 Code GmbH
  • Richard Russon

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 init.h.

Function Documentation

◆ 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:

◆ mutt_init()

int mutt_init ( struct ConfigSet cs,
const char *  dlevel,
const char *  dfile,
bool  skip_sys_rc,
struct ListHead *  commands 
)

Initialise NeoMutt.

Parameters
csConfig Set
dlevelCommand line debug level
dfileCommand line debug file
skip_sys_rcIf true, don't read the system config file
commandsList of config commands to execute
Return values
0Success
1Error

Definition at line 318 of file init.c.

320{
321 bool need_pause = false;
322 int rc = 1;
323 struct Buffer *err = buf_pool_get();
324 struct Buffer *buf = buf_pool_get();
325
327 alias_init();
329 hooks_init();
331 imap_init();
332#ifdef USE_LUA
334#endif
336
337 menu_init();
338 sb_init();
339#ifdef USE_NOTMUCH
340 nm_init();
341#endif
342
343#ifdef NEOMUTT_DIRECT_COLORS
344 /* Test if we run in a terminal which supports direct colours.
345 *
346 * The user/terminal can indicate their capability independent of the
347 * terminfo file by setting the COLORTERM environment variable to "truecolor"
348 * or "24bit" (case sensitive).
349 *
350 * Note: This is to test is less about whether the terminal understands
351 * direct color commands but more about whether ncurses believes it can send
352 * them to the terminal, e.g. ncurses ignores COLORTERM.
353 */
354 if (COLORS == 16777216) // 2^24
355 {
356 /* Ncurses believes the Terminal supports it check the environment variable
357 * to respect the user's choice */
358 const char *env_colorterm = mutt_str_getenv("COLORTERM");
359 if (env_colorterm && (mutt_str_equal(env_colorterm, "truecolor") ||
360 mutt_str_equal(env_colorterm, "24bit")))
361 {
362 cs_str_initial_set(cs, "color_directcolor", "yes", NULL);
363 cs_str_reset(cs, "color_directcolor", NULL);
364 }
365 }
366#endif
367
368 /* "$spool_file" precedence: config file, environment */
369 const char *p = mutt_str_getenv("MAIL");
370 if (!p)
371 p = mutt_str_getenv("MAILDIR");
372 if (!p)
373 {
374#ifdef HOMESPOOL
375 buf_concat_path(buf, NONULL(HomeDir), MAILPATH);
376#else
377 buf_concat_path(buf, MAILPATH, NONULL(Username));
378#endif
379 p = buf_string(buf);
380 }
381 cs_str_initial_set(cs, "spool_file", p, NULL);
382 cs_str_reset(cs, "spool_file", NULL);
383
384 p = mutt_str_getenv("REPLYTO");
385 if (p)
386 {
387 struct Buffer *token = buf_pool_get();
388
389 buf_printf(buf, "Reply-To: %s", p);
390 buf_seek(buf, 0);
391 parse_my_hdr(token, buf, 0, err); /* adds to UserHeader */
392 buf_pool_release(&token);
393 }
394
395 p = mutt_str_getenv("EMAIL");
396 if (p)
397 {
398 cs_str_initial_set(cs, "from", p, NULL);
399 cs_str_reset(cs, "from", NULL);
400 }
401
402 /* "$mailcap_path" precedence: config file, environment, code */
403 const char *env_mc = mutt_str_getenv("MAILCAPS");
404 if (env_mc)
405 {
406 cs_str_initial_set(cs, "mailcap_path", env_mc, NULL);
407 cs_str_reset(cs, "mailcap_path", NULL);
408 }
409
410 /* "$tmp_dir" precedence: config file, environment, code */
411 const char *env_tmp = mutt_str_getenv("TMPDIR");
412 if (env_tmp)
413 {
414 cs_str_initial_set(cs, "tmp_dir", env_tmp, NULL);
415 cs_str_reset(cs, "tmp_dir", NULL);
416 }
417
418 /* "$visual", "$editor" precedence: config file, environment, code */
419 const char *env_ed = mutt_str_getenv("VISUAL");
420 if (!env_ed)
421 env_ed = mutt_str_getenv("EDITOR");
422 if (!env_ed)
423 env_ed = "vi";
424 cs_str_initial_set(cs, "editor", env_ed, NULL);
425
426 const char *const c_editor = cs_subset_string(NeoMutt->sub, "editor");
427 if (!c_editor)
428 cs_str_reset(cs, "editor", NULL);
429
430 const char *charset = mutt_ch_get_langinfo_charset();
431 cs_str_initial_set(cs, "charset", charset, NULL);
432 cs_str_reset(cs, "charset", NULL);
433 mutt_ch_set_charset(charset);
434 FREE(&charset);
435
436#ifdef HAVE_GETSID
437 /* Unset suspend by default if we're the session leader */
438 if (getsid(0) == getpid())
439 {
440 cs_str_initial_set(cs, "suspend", "no", NULL);
441 cs_str_reset(cs, "suspend", NULL);
442 }
443#endif
444
445 /* RFC2368, "4. Unsafe headers"
446 * The creator of a mailto URL can't expect the resolver of a URL to
447 * understand more than the "subject" and "body" headers. Clients that
448 * resolve mailto URLs into mail messages should be able to correctly
449 * create RFC822-compliant mail messages using the "subject" and "body"
450 * headers. */
451 add_to_stailq(&MailToAllow, "body");
452 add_to_stailq(&MailToAllow, "subject");
453 /* Cc, In-Reply-To, and References help with not breaking threading on
454 * mailing lists, see https://github.com/neomutt/neomutt/issues/115 */
456 add_to_stailq(&MailToAllow, "in-reply-to");
457 add_to_stailq(&MailToAllow, "references");
458
459 if (STAILQ_EMPTY(&Muttrc))
460 {
461 const char *xdg_cfg_home = mutt_str_getenv("XDG_CONFIG_HOME");
462
463 if (!xdg_cfg_home && HomeDir)
464 {
465 buf_printf(buf, "%s/.config", HomeDir);
466 xdg_cfg_home = buf_string(buf);
467 }
468
469 char *config = find_cfg(HomeDir, xdg_cfg_home);
470 if (config)
471 {
473 }
474 }
475 else
476 {
477 struct ListNode *np = NULL;
478 STAILQ_FOREACH(np, &Muttrc, entries)
479 {
480 buf_strcpy(buf, np->data);
481 FREE(&np->data);
482 buf_expand_path(buf);
483 np->data = buf_strdup(buf);
484 if (access(np->data, F_OK))
485 {
486 mutt_perror("%s", np->data);
487 goto done; // TEST10: neomutt -F missing
488 }
489 }
490 }
491
492 if (!STAILQ_EMPTY(&Muttrc))
493 {
494 cs_str_string_set(cs, "alias_file", STAILQ_FIRST(&Muttrc)->data, NULL);
495 }
496
497 /* Process the global rc file if it exists and the user hasn't explicitly
498 * requested not to via "-n". */
499 if (!skip_sys_rc)
500 {
501 do
502 {
504 break;
505
506 buf_printf(buf, "%s/neomuttrc", SYSCONFDIR);
507 if (access(buf_string(buf), F_OK) == 0)
508 break;
509
510 buf_printf(buf, "%s/Muttrc", SYSCONFDIR);
511 if (access(buf_string(buf), F_OK) == 0)
512 break;
513
514 buf_printf(buf, "%s/neomuttrc", PKGDATADIR);
515 if (access(buf_string(buf), F_OK) == 0)
516 break;
517
518 buf_printf(buf, "%s/Muttrc", PKGDATADIR);
519 } while (false);
520
521 if (access(buf_string(buf), F_OK) == 0)
522 {
523 if (source_rc(buf_string(buf), err) != 0)
524 {
525 mutt_error("%s", buf_string(err));
526 need_pause = true; // TEST11: neomutt (error in /etc/neomuttrc)
527 }
528 }
529 }
530
531 /* Read the user's initialization file. */
532 struct ListNode *np = NULL;
533 STAILQ_FOREACH(np, &Muttrc, entries)
534 {
535 if (np->data)
536 {
537 if (source_rc(np->data, err) != 0)
538 {
539 mutt_error("%s", buf_string(err));
540 need_pause = true; // TEST12: neomutt (error in ~/.neomuttrc)
541 }
542 }
543 }
544
545 if (execute_commands(commands) != 0)
546 need_pause = true; // TEST13: neomutt -e broken
547
548 if (!get_hostname(cs))
549 goto done;
550
551 char name[256] = { 0 };
552 const char *c_real_name = cs_subset_string(NeoMutt->sub, "real_name");
553 if (!c_real_name)
554 {
555 struct passwd *pw = getpwuid(getuid());
556 if (pw)
557 {
558 c_real_name = mutt_gecos_name(name, sizeof(name), pw);
559 }
560 }
561 cs_str_initial_set(cs, "real_name", c_real_name, NULL);
562 cs_str_reset(cs, "real_name", NULL);
563
564 /* The command line overrides the config */
565 if (dlevel)
566 cs_str_reset(cs, "debug_level", NULL);
567 if (dfile)
568 cs_str_reset(cs, "debug_file", NULL);
569
570 if (mutt_log_start() < 0)
571 {
572 mutt_perror("log file");
573 goto done;
574 }
575
576 if (need_pause && !OptNoCurses)
577 {
579 if (mutt_any_key_to_continue(NULL) == 'q')
580 goto done; // TEST14: neomutt -e broken (press 'q')
581 }
582
583 const char *const c_tmp_dir = cs_subset_path(NeoMutt->sub, "tmp_dir");
584 if (mutt_file_mkdir(c_tmp_dir, S_IRWXU) < 0)
585 {
586 mutt_error(_("Can't create %s: %s"), c_tmp_dir, strerror(errno));
587 goto done;
588 }
589
592
593#ifdef USE_NOTMUCH
594 const bool c_virtual_spool_file = cs_subset_bool(NeoMutt->sub, "virtual_spool_file");
595 if (c_virtual_spool_file)
596 {
597 /* Find the first virtual folder and open it */
598 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
600 struct MailboxNode *mp = STAILQ_FIRST(&ml);
601 if (mp)
602 cs_str_string_set(cs, "spool_file", mailbox_path(mp->mailbox), NULL);
604 }
605#endif
606 rc = 0;
607
608done:
609 buf_pool_release(&err);
610 buf_pool_release(&buf);
611 return rc;
612}
void alias_init(void)
Set up the Alias globals.
Definition: alias.c:714
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:160
void buf_seek(struct Buffer *buf, size_t offset)
Set current read/write position to offset from beginning.
Definition: buffer.c:621
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:394
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
Definition: buffer.c:570
size_t buf_concat_path(struct Buffer *buf, const char *dir, const char *fname)
Join a directory name and a filename.
Definition: buffer.c:508
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
void commands_init(void)
Initialize commands array and register default commands.
Definition: commands.c:1703
int source_rc(const char *rcfile_path, struct Buffer *err)
Read an initialization file.
Definition: commands.c:205
void mutt_comp_init(void)
Setup feature commands.
Definition: compress.c:91
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:292
const char * cs_subset_path(const struct ConfigSubset *sub, const char *name)
Get a path config item by name.
Definition: helpers.c:169
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:48
char * HomeDir
User's home directory.
Definition: globals.c:38
int cs_str_initial_set(const struct ConfigSet *cs, const char *name, const char *value, struct Buffer *err)
Set the initial value of a config item.
Definition: set.c:503
int cs_str_reset(const struct ConfigSet *cs, const char *name, struct Buffer *err)
Reset a config item to its initial value.
Definition: set.c:438
int cs_str_string_set(const struct ConfigSet *cs, const char *name, const char *value, struct Buffer *err)
Set a config item by string.
Definition: set.c:640
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:223
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition: mailbox.h:51
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
Definition: curs_lib.c:173
struct ListHead MailToAllow
List of regexes to identify non-spam emails.
Definition: globals.c:42
int mutt_file_mkdir(const char *path, mode_t mode)
Recursively create directories.
Definition: file.c:971
bool OptNoCurses
(pseudo) when sending in batch mode
Definition: globals.c:72
struct ListHead Muttrc
List of config files to read.
Definition: globals.c:52
char * Username
User's login name.
Definition: globals.c:41
void mutt_grouplist_init(void)
Initialize the GroupList singleton.
Definition: group.c:96
enum CommandResult parse_my_hdr(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'my_hdr' command - Implements Command::parse() -.
Definition: commands.c:814
int log_disp_terminal(time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...)
Save a log line to the terminal - Implements log_dispatcher_t -.
Definition: logging.c:441
#define mutt_error(...)
Definition: logging2.h:92
#define mutt_perror(...)
Definition: logging2.h:93
void mutt_hist_read_file(void)
Read the History from a file.
Definition: history.c:598
void mutt_hist_init(void)
Create a set of empty History ring buffers.
Definition: history.c:470
void hooks_init(void)
Setup feature commands.
Definition: hook.c:1043
void imap_init(void)
Setup feature commands.
Definition: imap.c:96
static char * find_cfg(const char *home, const char *xdg_cfg_home)
Find a config file.
Definition: init.c:109
static int execute_commands(struct ListHead *p)
Execute a set of NeoMutt commands.
Definition: init.c:77
static bool get_hostname(struct ConfigSet *cs)
Find the Fully-Qualified Domain Name.
Definition: init.c:183
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Definition: list.c:64
#define FREE(x)
Definition: memory.h:45
void menu_init(void)
Initialise all the Menus.
Definition: menu.c:79
char * mutt_ch_get_langinfo_charset(void)
Get the user's choice of character set.
Definition: charset.c:485
void mutt_ch_set_charset(const char *charset)
Update the records for a new character set.
Definition: charset.c:1077
void log_queue_flush(log_dispatcher_t disp)
Replay the log queue.
Definition: logging.c:346
#define _(a)
Definition: message.h:28
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:709
const char * mutt_str_getenv(const char *name)
Get an environment variable.
Definition: string.c:775
int mutt_log_start(void)
Enable file logging.
Definition: mutt_logging.c:248
void mutt_lua_init(void)
Setup feature commands.
Definition: mutt_lua.c:464
char * mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw)
Lookup a user's real name in /etc/passwd.
Definition: muttlib.c:367
void add_to_stailq(struct ListHead *head, const char *str)
Add a string to a list.
Definition: muttlib.c:1147
int mutt_set_xdg_path(enum XdgType type, struct Buffer *buf)
Find an XDG path or its fallback.
Definition: muttlib.c:932
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:328
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
Definition: neomutt.c:163
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
Definition: neomutt.c:186
void nm_init(void)
Setup feature commands.
Definition: notmuch.c:108
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
@ XDG_CONFIG_DIRS
XDG system dir: /etc/xdg.
Definition: protos.h:45
#define STAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:324
#define STAILQ_FIRST(head)
Definition: queue.h:350
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
#define STAILQ_EMPTY(head)
Definition: queue.h:348
void sb_init(void)
Set up the Sidebar.
Definition: sidebar.c:201
#define NONULL(x)
Definition: string2.h:37
String manipulation buffer.
Definition: buffer.h:36
A List node for strings.
Definition: list.h:35
char * data
String.
Definition: list.h:36
List of Mailboxes.
Definition: mailbox.h:166
struct Mailbox * mailbox
Mailbox in the list.
Definition: mailbox.h:167
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
void driver_tags_init(void)
Initialize structures used for tags.
Definition: tags.c:233
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_opts_cleanup()

void mutt_opts_cleanup ( void  )

Clean up before quitting.

Definition at line 262 of file init.c.

263{
265
267 sb_cleanup();
268
274
277
278 /* Lists of strings */
288
290
292 FREE(&HomeDir);
295 FREE(&Username);
296
298
300
303
306}
void alias_cleanup(void)
Clean up the Alias globals.
Definition: alias.c:722
void mutt_colors_cleanup(void)
Cleanup all the colours.
Definition: color.c:64
void source_stack_cleanup(void)
Free memory from the stack used for the source command.
Definition: commands.c:1627
void commands_cleanup(void)
Free Commands array.
Definition: command.c:65
struct ReplaceList SpamList
List of regexes to match subscribed mailing lists.
Definition: globals.c:46
struct RegexList SubscribedLists
List of header patterns to unignore (see)
Definition: globals.c:48
struct RegexList UnSubscribedLists
Definition: globals.c:54
struct RegexList UnMailLists
List of regexes to exclude false matches in SubscribedLists.
Definition: globals.c:52
struct RegexList MailLists
List of permitted fields in a mailto: url.
Definition: globals.c:40
struct ListHead Ignore
List of regexes to match mailing lists.
Definition: globals.c:38
struct RegexList NoSpamList
List of regexes and patterns to match spam emails.
Definition: globals.c:44
struct ListHead UnIgnore
List of regexes to exclude false matches in MailLists.
Definition: globals.c:50
char * LastFolder
Previously selected mailbox.
Definition: globals.c:44
char * ShortHostname
Short version of the hostname.
Definition: globals.c:39
struct ListHead MimeLookupList
List of mime types that that shouldn't use the mailcap entry.
Definition: globals.c:51
struct ListHead AlternativeOrderList
List of preferred mime types to display.
Definition: globals.c:48
struct ListHead AutoViewList
List of mime types to auto view.
Definition: globals.c:49
char * CurrentFolder
Currently selected mailbox.
Definition: globals.c:43
struct ListHead UserHeader
List of custom headers to add to outgoing emails.
Definition: globals.c:54
struct ListHead HeaderOrderList
List of header fields in the order they should be displayed.
Definition: globals.c:50
void mutt_grouplist_cleanup(void)
Free GroupList singleton resource.
Definition: group.c:108
void mutt_hist_cleanup(void)
Free all the history lists.
Definition: history.c:443
void mutt_delete_hooks(HookFlags type)
Delete matching hooks.
Definition: hook.c:391
#define MUTT_HOOK_NO_FLAGS
No flags are set.
Definition: hook.h:36
void mutt_keys_cleanup(void)
Free the key maps.
Definition: init.c:230
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122
void mutt_regexlist_free(struct RegexList *rl)
Free a RegexList object.
Definition: regex.c:179
void mutt_replacelist_free(struct ReplaceList *rl)
Free a ReplaceList object.
Definition: regex.c:450
void sb_cleanup(void)
Clean up the Sidebar.
Definition: sidebar.c:213
void driver_tags_cleanup(void)
Deinitialize structures used for tags.
Definition: tags.c:245
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_query_variables()

int mutt_query_variables ( struct ListHead *  queries,
bool  show_docs 
)

Implement the -Q command line flag.

Parameters
queriesList of query strings
show_docsIf true, show one-liner docs for the config item
Return values
0Success, all queries exist
1Error

Definition at line 621 of file init.c.

622{
623 struct Buffer *value = buf_pool_get();
624 struct Buffer *tmp = buf_pool_get();
625 int rc = 0;
626
627 struct ListNode *np = NULL;
628 STAILQ_FOREACH(np, queries, entries)
629 {
630 buf_reset(value);
631
632 struct HashElem *he = cs_subset_lookup(NeoMutt->sub, np->data);
633 if (he)
634 {
635 if (he->type & D_INTERNAL_DEPRECATED)
636 {
637 mutt_warning(_("Option %s is deprecated"), np->data);
638 rc = 1;
639 continue;
640 }
641
642 int rv = cs_subset_he_string_get(NeoMutt->sub, he, value);
643 if (CSR_RESULT(rv) != CSR_SUCCESS)
644 {
645 rc = 1;
646 continue;
647 }
648
649 int type = DTYPE(he->type);
650 if (type == DT_PATH)
651 mutt_pretty_mailbox(value->data, value->dsize);
652
653 if ((type != DT_BOOL) && (type != DT_NUMBER) && (type != DT_LONG) && (type != DT_QUAD))
654 {
655 buf_reset(tmp);
656 pretty_var(buf_string(value), tmp);
657 buf_copy(value, tmp);
658 }
659
660 dump_config_neo(NeoMutt->sub->cs, he, value, NULL,
661 show_docs ? CS_DUMP_SHOW_DOCS : CS_DUMP_NO_FLAGS, stdout);
662 continue;
663 }
664
665 mutt_warning(_("Unknown option %s"), np->data);
666 rc = 1;
667 }
668
669 buf_pool_release(&value);
670 buf_pool_release(&tmp);
671
672 return rc; // TEST16: neomutt -Q charset
673}
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:75
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:600
size_t pretty_var(const char *str, struct Buffer *buf)
Escape and stringify a config item value.
Definition: dump.c:85
void dump_config_neo(struct ConfigSet *cs, struct HashElem *he, struct Buffer *value, struct Buffer *initial, ConfigDumpFlags flags, FILE *fp)
Dump the config in the style of NeoMutt.
Definition: dump.c:108
void mutt_pretty_mailbox(char *buf, size_t buflen)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:475
#define CS_DUMP_NO_FLAGS
No flags are set.
Definition: dump.h:35
#define CS_DUMP_SHOW_DOCS
Show one-liner documentation for the config item.
Definition: dump.h:45
#define CSR_RESULT(x)
Definition: set.h:52
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
#define mutt_warning(...)
Definition: logging2.h:90
size_t dsize
Length of data.
Definition: buffer.h:39
char * data
Pointer to data.
Definition: buffer.h:37
struct ConfigSet * cs
Parent ConfigSet.
Definition: subset.h:51
The item stored in a Hash Table.
Definition: hash.h:43
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Definition: hash.h:44
int cs_subset_he_string_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
Definition: subset.c:332
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
Definition: subset.c:187
#define DTYPE(t)
Definition: types.h:50
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
Definition: types.h:88
@ DT_NUMBER
a number
Definition: types.h:39
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:41
@ DT_LONG
a number (long)
Definition: types.h:36
@ DT_PATH
a path to a file/directory
Definition: types.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function: