NeoMutt  2020-09-25
Teaching an old dog new tricks
DOXYGEN
dump.h
Go to the documentation of this file.
1 
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 
34 typedef uint16_t ConfigDumpFlags;
35 #define CS_DUMP_NO_FLAGS 0
36 #define CS_DUMP_ONLY_CHANGED (1 << 0)
37 #define CS_DUMP_HIDE_SENSITIVE (1 << 1)
38 #define CS_DUMP_NO_ESCAPING (1 << 2)
39 #define CS_DUMP_HIDE_NAME (1 << 3)
40 #define CS_DUMP_HIDE_VALUE (1 << 4)
41 #define CS_DUMP_SHOW_DEFAULTS (1 << 5)
42 #define CS_DUMP_SHOW_DISABLED (1 << 6)
43 #define CS_DUMP_SHOW_SYNONYMS (1 << 7)
44 #define CS_DUMP_SHOW_DEPRECATED (1 << 8)
45 #define CS_DUMP_SHOW_DOCS (1 << 9)
46 
47 void dump_config_neo(struct ConfigSet *cs, struct HashElem *he, struct Buffer *value, struct Buffer *initial, ConfigDumpFlags flags, FILE *fp);
48 bool dump_config(struct ConfigSet *cs, ConfigDumpFlags flags, FILE *fp);
49 size_t escape_string(struct Buffer *buf, const char *src);
50 size_t pretty_var(const char *str, struct Buffer *buf);
51 
52 #endif /* MUTT_CONFIG_DUMP_H */
Container for lots of config items.
Definition: set.h:228
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
Definition: dump.c:46
String manipulation buffer.
Definition: buffer.h:33
bool dump_config(struct ConfigSet *cs, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
Definition: dump.c:165
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:106
size_t pretty_var(const char *str, struct Buffer *buf)
Escape and stringify a config item value.
Definition: dump.c:83
uint16_t ConfigDumpFlags
Flags for dump_config(), e.g. CS_DUMP_ONLY_CHANGED.
Definition: dump.h:32
The item stored in a Hash Table.
Definition: hash.h:43