49 if (!cs || !var || !cdef)
63 const char *value,
struct Buffer *err)
69 if (value && (value[0] ==
'\0'))
72 struct Slist *list = NULL;
94 rc = cdef->
validator(cs, cdef, (intptr_t) list, err);
105 *(
struct Slist **) var = list;
157 if (!cs || !var || !cdef)
170 rc = cdef->
validator(cs, cdef, value, err);
184 *(
struct Slist **) var = list;
194 if (!cs || !var || !cdef)
199 return (intptr_t) list;
207 const char *value,
struct Buffer *err)
215 if (value && (value[0] ==
'\0'))
236 rc = cdef->
validator(cs, cdef, (intptr_t) copy, err);
245 *(
struct Slist **) var = copy;
255 const char *value,
struct Buffer *err)
263 if (value && (value[0] ==
'\0'))
281 rc = cdef->
validator(cs, cdef, (intptr_t) copy, err);
290 *(
struct Slist **) var = copy;
301 if (!cs || !var || !cdef)
304 struct Slist *list = NULL;
305 const char *initial = (
const char *) cdef->
initial;
326 rc = cdef->
validator(cs, cdef, (intptr_t) list, err);
340 *(
struct Slist **) var = list;
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
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_ERR_CODE
Problem with the code.
#define CSR_SUC_EMPTY
Value is empty/unset.
#define CSR_SUCCESS
Action completed successfully.
const struct ConfigSetType CstSlist
Config type representing a list of strings.
static void slist_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
Destroy an Slist object - Implements ConfigSetType::destroy() -.
static intptr_t slist_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get a Slist from a Slist config item - Implements ConfigSetType::native_get() -.
static int slist_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set a Slist config item by Slist - Implements ConfigSetType::native_set() -.
static int slist_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset a Slist to its initial value - Implements ConfigSetType::reset() -.
static int slist_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get a Slist as a string - Implements ConfigSetType::string_get() -.
static int slist_string_minus_equals(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
Remove from a Slist by string - Implements ConfigSetType::string_minus_equals() -.
static int slist_string_plus_equals(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
Add to a Slist by string - Implements ConfigSetType::string_plus_equals() -.
static int slist_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set a Slist by string - Implements ConfigSetType::string_set() -.
Convenience wrapper for the library headers.
struct Slist * slist_remove_string(struct Slist *list, const char *str)
Remove a string from a list.
struct Slist * slist_parse(const char *str, uint32_t flags)
Parse a list of strings into a list.
void slist_free(struct Slist **ptr)
Free an Slist object.
bool slist_equal(const struct Slist *a, const struct Slist *b)
Compare two string lists.
struct Slist * slist_add_string(struct Slist *list, const char *str)
Add a string to a list.
bool slist_is_member(const struct Slist *list, const char *str)
Is a string a member of a list?
struct Slist * slist_dup(const struct Slist *list)
Create a copy of an Slist object.
int slist_to_buffer(const struct Slist *list, struct Buffer *buf)
Export an Slist to a Buffer.
struct Slist * slist_new(uint32_t flags)
Create a new string list.
char * mutt_str_dup(const char *str)
Copy a string, safely.
String manipulation buffer.
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.
@ DT_SLIST
a list of strings