75 const char *value,
struct Buffer *err)
78 if (value && (value[0] ==
'\0'))
104 rc = cdef->
validator(cs, cdef, (intptr_t) addr, err);
116 *(
struct Address **) var = addr;
179 const struct ConfigDef *cdef, intptr_t value,
186 rc = cdef->
validator(cs, cdef, value, err);
200 *(
struct Address **) var = addr;
212 return (intptr_t) addr;
222 const char *initial = (
const char *) cdef->
initial;
231 rc = cdef->
validator(cs, cdef, (intptr_t) a, err);
287 return (
const struct Address *) value;
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
void mutt_addr_free(struct Address **ptr)
Free a single Address.
size_t mutt_addr_write(struct Buffer *buf, struct Address *addr, bool display)
Write a single Address to a buffer.
struct Address * mutt_addr_copy(const struct Address *addr)
Copy the real address.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
struct Address * address_new(const char *addr)
Create an Address from a string.
const struct ConfigSetType CstAddress
Config type representing an Email Address.
static struct Address * address_dup(struct Address *addr)
Create a copy of an Address object.
const struct Address * cs_subset_address(const struct ConfigSubset *sub, const char *name)
Get an Address config item by name.
Representation of an email address.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
struct Buffer * buf_new(const char *str)
Allocate a new Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
struct Buffer * buf_dup(const struct Buffer *buf)
Copy a Buffer into a new allocated buffer.
Convenience wrapper for the config headers.
struct HashElem * cs_get_base(struct HashElem *he)
Find the root Config Item.
#define CSR_ERR_INVALID
Value hasn't been set.
#define CSR_INV_VALIDATOR
Value was rejected by the validator.
#define CSR_SUC_EMPTY
Value is empty/unset.
#define CSR_SUCCESS
Action completed successfully.
Config type representing an email address.
static void address_destroy(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef)
Destroy an Address object - Implements ConfigSetType::destroy() -.
static intptr_t address_native_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an Address object from an Address config item - Implements ConfigSetType::native_get() -.
static int address_native_set(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set an Address config item by Address object - Implements ConfigSetType::native_set() -.
static int address_reset(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset an Address to its initial value - Implements ConfigSetType::reset() -.
static int address_string_get(const struct ConfigSet *cs, void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get an Address as a string - Implements ConfigSetType::string_get() -.
static int address_string_set(const struct ConfigSet *cs, void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set an Address by string - Implements ConfigSetType::string_set() -.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
#define TAILQ_FIRST(head)
#define TAILQ_HEAD_INITIALIZER(head)
struct Buffer * personal
Real name of address.
struct Buffer * mailbox
Mailbox and host address.
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.
A set of inherited config items.
The item stored in a Hash Table.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
intptr_t cs_subset_he_native_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
Natively get the value of a HashElem config item.
struct HashElem * cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name)
Create a Subset config item (inherited)
#define D_INTERNAL_INITIAL_SET
Config item must have its initial value freed.
@ DT_ADDRESS
e-mail address
#define D_NOT_EMPTY
Empty strings are not allowed.