61 const char *value,
struct Buffer *err)
64 if (value && (value[0] ==
'\0'))
82 char opt[128] = { 0 };
84 snprintf(opt,
sizeof(opt),
_(
"Option %s: "), cdef->
name);
103 rc = cdef->
validator(cs, cdef, (intptr_t) exp, err);
114 *(
struct Expando **) var = exp;
137 const char *str = NULL;
161 const struct ConfigDef *cdef, intptr_t value,
182 rc = cdef->
validator(cs, cdef, value, err);
190 struct Expando *exp_copy = NULL;
203 *(
struct Expando **) var = exp_copy;
213 if (!cs || !var || !cdef)
218 return (intptr_t) exp;
226 const char *value,
struct Buffer *err)
229 if (!value || (value[0] ==
'\0'))
240 if (exp_old && exp_old->
string)
251 char opt[128] = { 0 };
253 snprintf(opt,
sizeof(opt),
_(
"Option %s: "), cdef->
name);
266 rc = cdef->
validator(cs, cdef, (intptr_t) exp_new, err);
276 *(
struct Expando **) var = exp_new;
287 if (!cs || !var || !cdef)
291 const char *initial = (
const char *) cdef->
initial;
316 rc = cdef->
validator(cs, cdef, (intptr_t) exp, err);
330 *(
struct Expando **) var = exp;
372 return (
const struct Expando *) value;
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
size_t buf_insert(struct Buffer *buf, size_t offset, const char *s)
Add a string in the middle of a buffer.
Convenience wrapper for the config headers.
struct HashElem * cs_get_base(struct HashElem *he)
Find the root Config Item.
static bool startup_only(const struct ConfigDef *cdef, struct Buffer *err)
Validator function for D_ON_STARTUP.
#define CSR_ERR_INVALID
Value hasn't been set.
#define CSR_INV_VALIDATOR
Value was rejected by the validator.
#define CSR_SUC_NO_CHANGE
The value hasn't changed.
#define CSR_ERR_CODE
Problem with the code.
#define CSR_SUC_EMPTY
Value is empty/unset.
#define CSR_SUCCESS
Action completed successfully.
const struct ConfigSetType CstExpando
Config type representing an Expando.
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
struct Expando * expando_parse(const char *str, const struct ExpandoDefinition *defs, struct Buffer *err)
Parse an Expando string.
void expando_free(struct Expando **ptr)
Free an Expando object.
bool expando_equal(const struct Expando *a, const struct Expando *b)
Compare two expandos.
static void expando_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
Destroy an Expando object - Implements ConfigSetType::destroy() -.
static int expando_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set an Expando object from an Expando config item - Implements ConfigSetType::native_get() -.
static intptr_t expando_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an Expando object from an Expando config item - Implements ConfigSetType::native_get() -.
static int expando_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset an Expando to its initial value - Implements ConfigSetType::reset() -.
static int expando_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get an Expando as a string - Implements ConfigSetType::string_get() -.
static int expando_string_plus_equals(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
Add to an Expando by string - Implements ConfigSetType::string_plus_equals() -.
static int expando_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set an Expando by string - Implements ConfigSetType::string_set() -.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
int mutt_str_asprintf(char **strp, const char *fmt,...)
String manipulation buffer.
const char * name
User-visible name.
int(* validator)(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
intptr_t data
Extra variable data.
intptr_t initial
Initial value.
uint32_t type
Variable type, e.g. DT_STRING.
Container for lots of config items.
A set of inherited config items.
Definition of a format string.
const char * string
Pointer to the parsed string.
The item stored in a Hash Table.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
intptr_t cs_subset_he_native_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
Natively get the value of a HashElem config item.
struct HashElem * cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name)
Create a Subset config item (inherited)
#define D_INTERNAL_INITIAL_SET
Config item must have its initial value freed.
#define D_NOT_EMPTY
Empty strings are not allowed.