71 if ((*src ==
'\\') || (*src ==
'"'))
111 if (!he || !value || !fp)
125 const char *syn = (
const char *) cdef->
initial;
126 fprintf(fp,
"# synonym: %s -> %s\n",
name, syn);
133 fprintf(fp,
"# %s\n", cdef->
docs);
139 if (show_name && show_value)
146 static int seq_num = 1;
150 static const char *url =
"https://neomutt.org/guide/configuration#set-myvar";
151 fprintf(fp,
"\033]8;id=%d;%s\a%s\033]8;;\a", seq_num++, url,
name);
156 for (
char *underscore = fragment; (underscore = strchr(underscore,
'_')); underscore++)
161 static const char *url =
"https://neomutt.org/guide/reference";
162 fprintf(fp,
"\033]8;id=%d;%s#%s\a%s\033]8;;\a", seq_num++, url, fragment,
name);
168 fprintf(fp,
"%s",
name);
171 if (show_name && show_value)
174 fprintf(fp,
"%s", value->
data);
175 if (show_name || show_value)
182 fprintf(fp,
"# %s %s %s\n", cst->
name,
name, value->
data);
199 if (!cs || !hea || !fp)
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
size_t pretty_var(const char *str, struct Buffer *buf)
Escape and stringify a config item value.
bool dump_config(struct ConfigSet *cs, struct HashElemArray *hea, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
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.
void mutt_pretty_mailbox(char *buf, size_t buflen)
Shorten a mailbox path using '~' or '='.
#define CS_DUMP_SHOW_SYNONYMS
Show synonyms and the config items they're linked to.
#define CS_DUMP_HIDE_VALUE
Do not print the value of the config item.
#define CS_DUMP_SHOW_DEPRECATED
Show config items that aren't used any more.
#define CS_DUMP_NO_ESCAPING
Do not escape special chars, or quote the string.
#define CS_DUMP_HIDE_SENSITIVE
Obscure sensitive information like passwords.
uint16_t ConfigDumpFlags
Flags for dump_config(), e.g. CS_DUMP_ONLY_CHANGED.
#define CS_DUMP_LINK_DOCS
Link to the online docs.
#define CS_DUMP_ONLY_CHANGED
Only show config that the user has changed.
#define CS_DUMP_HIDE_NAME
Do not print the name of the config item.
#define CS_DUMP_SHOW_DEFAULTS
Show the default value for the config item.
#define CS_DUMP_SHOW_DOCS
Show one-liner documentation for the config item.
const struct ConfigSetType * cs_get_type_def(const struct ConfigSet *cs, unsigned int type)
Get the definition for a type.
int cs_he_string_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
int cs_he_initial_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
Get the initial, or parent, value of a config item.
#define CSR_SUCCESS
Action completed successfully.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
const char * name
User-visible name.
intptr_t initial
Initial value.
uint32_t type
Variable type, e.g. DT_STRING.
const char * docs
One-liner description.
const char * name
Name of the type, e.g. "String".
Container for lots of config items.
The item stored in a Hash Table.
union HashKey key
Key representing the data.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
void * data
User-supplied data.
Constants for all the config types.
#define IS_MAILBOX(flags)
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
@ DT_SYNONYM
synonym for another variable
@ DT_MYVAR
a user-defined variable (my_foo)
@ DT_PATH
a path to a file/directory
#define D_SENSITIVE
Contains sensitive value, e.g. password.
const char * strkey
String key.