50 const char **str = (
const char **) var;
61 const char *value,
struct Buffer *err)
64 if (value && (value[0] ==
'\0'))
85 rc = cdef->
validator(cdef, (intptr_t) value, err);
97 *(
const char **) var = str;
116 const char *str = NULL;
119 str = *(
const char **) var;
134 intptr_t value,
struct Buffer *err)
136 const char *str = (
const char *) value;
139 if (str && (str[0] ==
'\0'))
171 *(
const char **) var = str;
180 const char *str = *(
const char **) var;
182 return (intptr_t) str;
189 const char *value,
struct Buffer *err)
192 if (!value || (value[0] ==
'\0'))
201 const char **var_str = (
const char **) var;
210 rc = cdef->
validator(cdef, (intptr_t) str, err);
230 const char *initial = (
const char *) cdef->
initial;
231 const char *value = *(
const char **) var;
275 *(
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(void *var, const struct ConfigDef *cdef)
Destroy a String - Implements ConfigSetType::destroy() -.
static bool string_has_been_set(void *var, const struct ConfigDef *cdef)
Is the config value different to its initial value? - Implements ConfigSetType::has_been_set() -.
static intptr_t string_native_get(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(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(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset a String to its initial value - Implements ConfigSetType::reset() -.
static int string_string_get(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(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(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 ConfigDef *cdef, intptr_t value, struct Buffer *err)
intptr_t initial
Initial value.
uint32_t type
Variable type, e.g. DT_STRING.
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.