Go to the documentation of this file.
49 "no",
"yes",
"ask-no",
"ask-yes", NULL,
56 const char *value,
struct Buffer *err)
79 if (num == (*(
char *) var))
84 int rc = cdef->
validator(cs, cdef, (intptr_t) num, err);
109 value = *(
char *) var;
135 if (value == (*(
char *) var))
140 int rc = cdef->
validator(cs, cdef, value, err);
146 *(
char *) var = value;
156 return *(
char *) var;
165 if (cdef->
initial == (*(
char *) var))
204 if (!sub || !he || !he->
data)
212 if (value == INT_MIN)
#define DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
int quad_str_toggle(struct ConfigSubset *sub, const char *name, struct Buffer *err)
Toggle the value of a quad.
static int quad_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset a Quad-option to its initial value - Implements ConfigSetType::reset()
String manipulation buffer.
#define CSR_SUCCESS
Action completed successfully.
void * data
User-supplied data.
#define DTYPE(x)
Mask for the Data Type.
static int quad_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set a Quad-option config item by int - Implements ConfigSetType::native_set()
#define CSR_SUC_NO_CHANGE
The value hasn't changed.
void cs_subset_notify_observers(const struct ConfigSubset *sub, struct HashElem *he, enum NotifyConfig ev)
Notify all observers of an event.
@ LL_DEBUG1
Log at debug level 1.
static intptr_t quad_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an int object from a Quad-option config item - Implements ConfigSetType::native_get()
intptr_t cs_he_native_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
Natively get the value of a HashElem config item.
#define mutt_array_size(x)
int quad_he_toggle(struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
Toggle the value of a quad.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
static int quad_toggle(int opt)
Toggle (invert) the value of a quad option.
@ NT_CONFIG_SET
Config item has been set.
const struct ConfigSetType cst_quad
Config type representing a quad-option.
struct HashElem * cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name)
Create a Subset config item (inherited)
intptr_t initial
Initial value.
struct ConfigSet * cs
Parent ConfigSet.
static int quad_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get a Quad-option as a string - Implements ConfigSetType::string_get()
#define mutt_debug(LEVEL,...)
int type
Type of data stored in Hash Table, e.g. DT_STRING.
struct HashElem * cs_get_base(struct HashElem *he)
Find the root Config Item.
static int quad_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set a Quad-option by string - Implements ConfigSetType::string_set()
int(* validator)(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate a config variable.
#define CSR_ERR_CODE
Problem with the code.
The item stored in a Hash Table.
Type definition for a config item.
Container for lots of config items.
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
#define CSR_ERR_INVALID
Value hasn't been set.
#define CSR_INV_TYPE
Value is not valid for the type.
A set of inherited config items.
const char * QuadValues[]
Valid strings for creating a QuadValue.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
int cs_he_native_set(const struct ConfigSet *cs, struct HashElem *he, intptr_t value, struct Buffer *err)
Natively set the value of a HashElem config item.
#define CSR_INV_VALIDATOR
Value was rejected by the validator.