49 const char **str = (
const char **) var;
60 const char *value,
struct Buffer *err)
63 if (value && (value[0] ==
'\0'))
84 rc = cdef->
validator(cs, cdef, (intptr_t) value, err);
96 *(
const char **) var = str;
116 const char *str = NULL;
119 str = *(
const char **) var;
134 const struct ConfigDef *cdef, intptr_t value,
137 const char *str = (
const char *) value;
140 if (str && (str[0] ==
'\0'))
159 rc = cdef->
validator(cs, cdef, value, err);
172 *(
const char **) var = str;
182 const char *str = *(
const char **) var;
184 return (intptr_t) str;
192 const char *value,
struct Buffer *err)
195 if (!value || (value[0] ==
'\0'))
204 const char **var_str = (
const char **) var;
213 rc = cdef->
validator(cs, cdef, (intptr_t) str, err);
268 *(
const char **) var = str;
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.
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_SUC_EMPTY
Value is empty/unset.
#define CSR_SUCCESS
Action completed successfully.
const struct ConfigSetType CstString
Config type representing a string.
static void string_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
Destroy a String - Implements ConfigSetType::destroy() -.
static intptr_t string_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get a string from a String config item - Implements ConfigSetType::native_get() -.
static int string_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set a String config item by string - Implements ConfigSetType::native_set() -.
static int string_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset a String to its initial value - Implements ConfigSetType::reset() -.
static int string_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get a String as a string - Implements ConfigSetType::string_get() -.
static int string_string_plus_equals(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
Add to a String by string - Implements ConfigSetType::string_plus_equals() -.
static int string_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set a String 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,...)
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
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 initial
Initial value.
uint32_t type
Variable type, e.g. DT_STRING.
Container for lots of config items.
Constants for all the config types.
#define D_INTERNAL_INITIAL_SET
Config item must have its initial value freed.
#define D_NOT_EMPTY
Empty strings are not allowed.