46 intptr_t value,
struct Buffer *err)
51 const char *str = (
const char *) value;
55 buf_printf(err,
_(
"'charset' must contain exactly one character set name"));
64 for (
char *p = strtok_r(s,
":", &q); p; p = strtok_r(NULL,
":", &q))
86 intptr_t value,
struct Buffer *err)
91 const struct Slist *list = (
const struct Slist *) value;
99 char const *charset = np->
data;
103 buf_printf(err,
_(
"Invalid value for option %s: %s"), cdef->
name, charset);
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
#define CSR_ERR_INVALID
Value hasn't been set.
#define CSR_SUCCESS
Action completed successfully.
int charset_slist_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the multiple "charset" config variables - Implements ConfigDef::validator() -.
int charset_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variables - Implements ConfigDef::validator() -.
bool mutt_ch_check_charset(const char *cs, bool strict)
Does iconv understand a character set?
Conversion between different character encodings.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
#define STAILQ_FOREACH(var, head, field)
String manipulation buffer.
const char * name
User-visible name.
uint32_t type
Variable type, e.g. DT_STRING.
Container for lots of config items.
struct ListHead head
List containing values.
Constants for all the config types.
#define D_CHARSET_SINGLE
Flag for charset_validator to allow only one charset.
#define D_CHARSET_STRICT
Flag for charset_validator to use strict char check.