58    buf_printf(err, 
_(
"Invalid enum value: %s"), value);
 
   64    if (num == (*(
unsigned char *) var))
 
   72      int rc = cdef->
validator(cdef, (intptr_t) num, err);
 
   78    *(
unsigned char *) var = num;
 
 
   96    value = *(
unsigned char *) var;
 
 
  119                           intptr_t value, 
struct Buffer *err)
 
  128    buf_printf(err, 
_(
"Invalid enum value: %ld"), (
long) value);
 
  132  if (value == (*(
unsigned char *) var))
 
  140    int rc = cdef->
validator(cdef, value, err);
 
  146  *(
unsigned char *) var = value;
 
 
  155  return *(
unsigned char *) var;
 
 
  163  return (cdef->
initial != (*(
unsigned char *) var));
 
 
  171  if (cdef->
initial == (*(
unsigned char *) var))
 
  185  *(
unsigned char *) var = cdef->
initial;
 
 
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
A collection of config items.
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_TYPE
Value is not valid for the type.
#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_SUCCESS
Action completed successfully.
const struct ConfigSetType CstEnum
Config type representing an enumeration.
Type representing an enumeration.
static bool enum_has_been_set(void *var, const struct ConfigDef *cdef)
Is the config value different to its initial value?
static intptr_t enum_native_get(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an int object from an Enumeration config item - Implements ConfigSetType::native_get() -.
static int enum_native_set(void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set an Enumeration config item by int - Implements ConfigSetType::native_set() -.
static int enum_reset(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset an Enumeration to its initial value - Implements ConfigSetType::reset() -.
static int enum_string_get(void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get an Enumeration as a string - Implements ConfigSetType::string_get() -.
static int enum_string_set(void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set an Enumeration by string - Implements ConfigSetType::string_set() -.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Convenience wrapper for the library headers.
String manipulation buffer.
int(* validator)(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
intptr_t data
Extra variable data.
intptr_t initial
Initial value.
const char * name
Config variable.
struct Mapping * lookup
Lookup table.
Constants for all the config types.