47 const char **str = (
const char **) var;
58 const char *value,
struct Buffer *err)
61 if (value && (value[0] ==
'\0'))
77 *(
const char **) var = str;
97 const char *str = NULL;
100 str = *(
const char **) var;
117 const char *str = (
const char *) value;
120 if (str && (str[0] ==
'\0'))
135 *(
const char **) var = str;
145 const char *str = *(
const char **) var;
147 return (intptr_t) str;
155 const char *value,
struct Buffer *err)
158 if (!value || (value[0] ==
'\0'))
164 const char **var_str = (
const char **) var;
200 *(
const char **) var = str;
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
#define CSR_SUC_NO_CHANGE
The value hasn't changed.
#define CSR_SUC_EMPTY
Value is empty/unset.
#define CSR_SUCCESS
Action completed successfully.
static void myvar_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
Destroy a MyVar - Implements ConfigSetType::destroy() -.
static intptr_t myvar_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get a string from a MyVar config item - Implements ConfigSetType::native_get() -.
static int myvar_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set a MyVar config item by string - Implements ConfigSetType::native_set() -.
static int myvar_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset a MyVar to its initial value - Implements ConfigSetType::reset() -.
static int myvar_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get a MyVar as a string - Implements ConfigSetType::string_get() -.
static int myvar_string_plus_equals(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
Add to a MyVar by string - Implements ConfigSetType::string_plus_equals() -.
static int myvar_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set a MyVar 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.
const struct ConfigSetType CstMyVar
Config type representing a MyVar.
String manipulation buffer.
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.
@ DT_MYVAR
a user-defined variable (my_foo)