NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
dump.h
Go to the documentation of this file.
1
22
23
#ifndef MUTT_CONFIG_DUMP_H
24
#define MUTT_CONFIG_DUMP_H
25
26
#include <stdbool.h>
27
#include <stdint.h>
28
#include <stdio.h>
29
30
struct
Buffer
;
31
struct
ConfigSet
;
32
struct
HashElem
;
33
struct
HashElemArray;
34
38
enum
ConfigDumpFlag
39
{
40
CS_DUMP_NONE
= 0,
41
CS_DUMP_ONLY_CHANGED
= 1U << 0,
42
CS_DUMP_HIDE_SENSITIVE
= 1U << 1,
43
CS_DUMP_NO_ESCAPING
= 1U << 2,
44
CS_DUMP_HIDE_NAME
= 1U << 3,
45
CS_DUMP_HIDE_VALUE
= 1U << 4,
46
CS_DUMP_SHOW_DEFAULTS
= 1U << 5,
47
CS_DUMP_SHOW_DISABLED
= 1U << 6,
48
CS_DUMP_SHOW_SYNONYMS
= 1U << 7,
49
CS_DUMP_SHOW_DEPRECATED
= 1U << 8,
50
CS_DUMP_SHOW_DOCS
= 1U << 9,
51
CS_DUMP_LINK_DOCS
= 1U << 10,
52
};
53
typedef
uint16_t
ConfigDumpFlags
;
54
55
void
dump_config_neo
(
struct
ConfigSet
*cs,
struct
HashElem
*he,
struct
Buffer
*value,
struct
Buffer
*initial,
ConfigDumpFlags
flags, FILE *fp);
56
bool
dump_config
(
struct
ConfigSet
*cs,
struct
HashElemArray *hea,
ConfigDumpFlags
flags, FILE *fp);
57
size_t
escape_string
(
struct
Buffer
*buf,
const
char
*src);
58
size_t
pretty_var
(
const
char
*str,
struct
Buffer
*buf);
59
60
#endif
/* MUTT_CONFIG_DUMP_H */
escape_string
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
Definition
dump.c:47
pretty_var
size_t pretty_var(const char *str, struct Buffer *buf)
Escape and stringify a config item value.
Definition
dump.c:87
ConfigDumpFlag
ConfigDumpFlag
Flags for dump_config(), e.g.
Definition
dump.h:39
CS_DUMP_HIDE_NAME
@ CS_DUMP_HIDE_NAME
Do not print the name of the config item.
Definition
dump.h:44
CS_DUMP_SHOW_DOCS
@ CS_DUMP_SHOW_DOCS
Show one-liner documentation for the config item.
Definition
dump.h:50
CS_DUMP_SHOW_DISABLED
@ CS_DUMP_SHOW_DISABLED
Show disabled config items, too.
Definition
dump.h:47
CS_DUMP_NONE
@ CS_DUMP_NONE
No flags are set.
Definition
dump.h:40
CS_DUMP_LINK_DOCS
@ CS_DUMP_LINK_DOCS
Link to the online docs.
Definition
dump.h:51
CS_DUMP_ONLY_CHANGED
@ CS_DUMP_ONLY_CHANGED
Only show config that the user has changed.
Definition
dump.h:41
CS_DUMP_SHOW_DEPRECATED
@ CS_DUMP_SHOW_DEPRECATED
Show config items that aren't used any more.
Definition
dump.h:49
CS_DUMP_SHOW_DEFAULTS
@ CS_DUMP_SHOW_DEFAULTS
Show the default value for the config item.
Definition
dump.h:46
CS_DUMP_HIDE_SENSITIVE
@ CS_DUMP_HIDE_SENSITIVE
Obscure sensitive information like passwords.
Definition
dump.h:42
CS_DUMP_HIDE_VALUE
@ CS_DUMP_HIDE_VALUE
Do not print the value of the config item.
Definition
dump.h:45
CS_DUMP_SHOW_SYNONYMS
@ CS_DUMP_SHOW_SYNONYMS
Show synonyms and the config items they're linked to.
Definition
dump.h:48
CS_DUMP_NO_ESCAPING
@ CS_DUMP_NO_ESCAPING
Do not escape special chars, or quote the string.
Definition
dump.h:43
dump_config
bool dump_config(struct ConfigSet *cs, struct HashElemArray *hea, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
Definition
dump.c:198
dump_config_neo
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:110
ConfigDumpFlags
uint16_t ConfigDumpFlags
Definition
dump.h:53
Buffer
String manipulation buffer.
Definition
buffer.h:36
ConfigSet
Container for lots of config items.
Definition
set.h:251
HashElem
The item stored in a Hash Table.
Definition
hash.h:44