92 he_list[index++] = he;
121 char scope[256] = { 0 };
122 snprintf(scope,
sizeof(scope),
"%s:",
sub->
name);
127 for (
size_t i = 0; he_list[i]; i++)
129 const char *item = he_list[i]->
key.
strkey;
153 struct Notify *not_parent)
160 sub->
cs = sub_parent->
cs;
165 char scope[256] = { 0 };
167 if (sub_parent && sub_parent->
name)
192 char scope[256] = { 0 };
194 snprintf(scope,
sizeof(scope),
"%s:%s", sub->
name, name);
226 char scope[256] = { 0 };
227 snprintf(scope,
sizeof(scope),
"%s:%s", sub->
name, name);
276 intptr_t value,
struct Buffer *err)
298 intptr_t value,
struct Buffer *err)
365 const char *value,
struct Buffer *err)
387 const char *value,
struct Buffer *err)
403 const char *value,
struct Buffer *err)
425 const char *value,
struct Buffer *err)
struct HashElem * cs_get_elem(const struct ConfigSet *cs, const char *name)
Get the HashElem representing a config item.
int cs_he_string_plus_equals(const struct ConfigSet *cs, struct HashElem *he, const char *value, struct Buffer *err)
Add to a config item by string.
int cs_he_reset(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
Reset a config item to its initial value.
int cs_he_delete(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
Delete config item from a config set.
int cs_he_string_set(const struct ConfigSet *cs, struct HashElem *he, const char *value, struct Buffer *err)
Set a config item by string.
struct HashElem * cs_get_base(struct HashElem *he)
Find the root Config Item.
int cs_he_native_set(const struct ConfigSet *cs, struct HashElem *he, intptr_t value, struct Buffer *err)
Natively set the value of a HashElem config item.
intptr_t cs_he_native_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
Natively get the value of a HashElem config item.
struct HashElem * cs_inherit_variable(const struct ConfigSet *cs, struct HashElem *he_parent, const char *name)
Create in inherited config item.
int cs_he_string_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
int cs_he_string_minus_equals(const struct ConfigSet *cs, struct HashElem *he, const char *value, struct Buffer *err)
Remove from a config item by string.
void cs_uninherit_variable(const struct ConfigSet *cs, const char *name)
Remove an inherited config item.
#define CSR_SUC_NO_CHANGE
The value hasn't changed.
#define CSR_ERR_CODE
Problem with the code.
#define CSR_SUCCESS
Action completed successfully.
#define mutt_debug(LEVEL,...)
int elem_list_sort(const void *a, const void *b, void *sdata)
Compare two HashElem pointers to config - Implements sort_t -.
struct HashElem * mutt_hash_walk(const struct HashTable *table, struct HashWalkState *state)
Iterate through all the HashElem's in a Hash Table.
@ LL_NOTIFY
Log of notifications.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
#define MUTT_MEM_CALLOC(n, type)
Convenience wrapper for the library headers.
struct Notify * notify_new(void)
Create a new notifications handler.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
void notify_free(struct Notify **ptr)
Free a notification handler.
char * mutt_str_dup(const char *str)
Copy a string, safely.
int mutt_istr_cmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
void mutt_qsort_r(void *base, size_t nmemb, size_t size, sort_t compar, void *sdata)
Sort an array, where the comparator has access to opaque data rather than requiring global variables.
String manipulation buffer.
Container for lots of config items.
struct HashTable * hash
Hash Table: "$name" -> ConfigDef.
A set of inherited config items.
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
const char * name
Scope name of Subset.
struct ConfigSet * cs
Parent ConfigSet.
struct ConfigSubset * parent
Parent Subset.
enum ConfigScope scope
Scope of Subset, e.g. SET_SCOPE_ACCOUNT.
const struct ConfigSubset * sub
Config Subset.
const char * name
Name of config item that changed.
struct HashElem * he
Config item that changed.
The item stored in a Hash Table.
union HashKey key
Key representing the data.
Cursor to iterate through a Hash Table.
Mapping between user-readable string and a constant.
int cs_subset_he_string_minus_equals(const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err)
Remove from a config item by string.
int cs_subset_he_string_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
int cs_subset_he_native_set(const struct ConfigSubset *sub, struct HashElem *he, intptr_t value, struct Buffer *err)
Natively set the value of a HashElem config item.
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
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.
int cs_subset_he_delete(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
Delete config item from a config.
struct HashElem ** get_elem_list(struct ConfigSet *cs)
Create a sorted list of all config items.
int cs_subset_he_reset(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
Reset a config item to its initial value.
int cs_subset_str_string_get(const struct ConfigSubset *sub, const char *name, struct Buffer *result)
Get a config item as a string.
int cs_subset_he_string_set(const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err)
Set a config item by string.
int cs_subset_str_string_set(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Set a config item by string.
struct HashElem * cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name)
Create a Subset config item (inherited)
struct ConfigSubset * cs_subset_new(const char *name, struct ConfigSubset *sub_parent, struct Notify *not_parent)
Create a new Config Subset.
void cs_subset_free(struct ConfigSubset **ptr)
Free a Config Subset.
static const struct Mapping ConfigEventNames[]
Names for logging.
int cs_subset_he_string_plus_equals(const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err)
Add to a config item by string.
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
void cs_subset_notify_observers(const struct ConfigSubset *sub, struct HashElem *he, enum NotifyConfig ev)
Notify all observers of an event.
NotifyConfig
Config notification types.
@ NT_CONFIG_DELETED
Config item has been deleted.
@ NT_CONFIG_RESET
Config item has been reset to initial, or parent, value.
@ NT_CONFIG_SET
Config item has been set.
const char * strkey
String key.