NeoMutt  2020-09-25
Teaching an old dog new tricks
DOXYGEN
subset.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_CONFIG_SUBSET_H
24 #define MUTT_CONFIG_SUBSET_H
25 
26 #include <stdint.h>
27 
28 struct Buffer;
29 struct ConfigSet;
30 struct HashElem;
31 struct Notify;
32 
37 {
41 };
42 
47 {
48  const char *name;
50  struct ConfigSubset *parent;
51  struct ConfigSet *cs;
52  struct Notify *notify;
53 };
54 
61 {
65 };
66 
71 {
72  const struct ConfigSubset *sub;
73  const char *name;
74  struct HashElem *he;
75 };
76 
77 struct ConfigSubset *cs_subset_new (const char *name, struct ConfigSubset *sub_parent, struct Notify *not_parent);
78 void cs_subset_free(struct ConfigSubset **ptr);
79 
80 struct HashElem *cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name);
81 struct HashElem *cs_subset_lookup (const struct ConfigSubset *sub, const char *name);
82 void cs_subset_notify_observers (const struct ConfigSubset *sub, struct HashElem *he, enum NotifyConfig ev);
83 
84 intptr_t cs_subset_he_native_get (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err);
85 int cs_subset_he_native_set (const struct ConfigSubset *sub, struct HashElem *he, intptr_t value, struct Buffer *err);
86 int cs_subset_he_reset (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err);
87 int cs_subset_he_string_get (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result);
88 int cs_subset_he_string_minus_equals (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err);
89 int cs_subset_he_string_plus_equals (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err);
90 int cs_subset_he_string_set (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err);
91 
92 intptr_t cs_subset_str_native_get (const struct ConfigSubset *sub, const char *name, struct Buffer *err);
93 int cs_subset_str_native_set (const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err);
94 int cs_subset_str_reset (const struct ConfigSubset *sub, const char *name, struct Buffer *err);
95 int cs_subset_str_string_get (const struct ConfigSubset *sub, const char *name, struct Buffer *result);
96 int cs_subset_str_string_minus_equals(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err);
97 int cs_subset_str_string_plus_equals (const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err);
98 int cs_subset_str_string_set (const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err);
99 
100 int elem_list_sort(const void *a, const void *b);
101 struct HashElem **get_elem_list(struct ConfigSet *cs);
102 
103 #endif /* MUTT_CONFIG_SUBSET_H */
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.
Definition: subset.c:270
Container for lots of config items.
Definition: set.h:228
NotifyConfig
Config notification types.
Definition: subset.h:60
struct ConfigSubset * parent
Parent Subset.
Definition: subset.h:50
This Config is NeoMutt-specific (global)
Definition: subset.h:38
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.
Definition: subset.c:292
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
Definition: subset.c:168
Config item&#39;s initial value has been set.
Definition: subset.h:64
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.
Definition: subset.c:395
const char * name
Scope name of Subset.
Definition: subset.h:48
void cs_subset_notify_observers(const struct ConfigSubset *sub, struct HashElem *he, enum NotifyConfig ev)
Notify all observers of an event.
Definition: subset.c:218
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.
Definition: subset.c:411
struct HashElem ** get_elem_list(struct ConfigSet *cs)
Create a sorted list of all config items.
Definition: subset.c:64
A config-change event.
Definition: subset.h:70
String manipulation buffer.
Definition: buffer.h:33
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.
Definition: subset.c:237
struct HashElem * cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name)
Create a Subset config item (inherited)
Definition: subset.c:189
intptr_t cs_subset_str_native_get(const struct ConfigSubset *sub, const char *name, struct Buffer *err)
Natively get the value of a string config item.
Definition: subset.c:254
struct ConfigSet * cs
Parent ConfigSet.
Definition: subset.h:51
struct HashElem * he
Config item that changed.
Definition: subset.h:74
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.
Definition: subset.c:373
int cs_subset_he_reset(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err)
Reset a config item to its initial value.
Definition: subset.c:307
int elem_list_sort(const void *a, const void *b)
Sort two HashElem pointers to config.
Definition: subset.c:48
int cs_subset_he_string_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
Definition: subset.c:341
A set of inherited config items.
Definition: subset.h:46
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.
Definition: subset.c:449
struct Notify * notify
Notifications system.
Definition: subset.h:52
struct ConfigSubset * cs_subset_new(const char *name, struct ConfigSubset *sub_parent, struct Notify *not_parent)
Create a new Config Subset.
Definition: subset.c:133
int cs_subset_str_reset(const struct ConfigSubset *sub, const char *name, struct Buffer *err)
Reset a config item to its initial value.
Definition: subset.c:327
This Config is Account-specific.
Definition: subset.h:39
Notification API.
Definition: notify.c:39
enum ConfigScope scope
Scope of Subset, e.g. SET_SCOPE_ACCOUNT.
Definition: subset.h:49
int cs_subset_str_string_minus_equals(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Remove from a config item by string.
Definition: subset.c:471
Config item has been set.
Definition: subset.h:62
int cs_subset_str_string_get(const struct ConfigSubset *sub, const char *name, struct Buffer *result)
Get a config item as a string.
Definition: subset.c:357
int cs_subset_str_string_plus_equals(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Add to a config item by string.
Definition: subset.c:433
Config item has been reset to initial, or parent, value.
Definition: subset.h:63
This Config is Mailbox-specific.
Definition: subset.h:40
The item stored in a Hash Table.
Definition: hash.h:43
void cs_subset_free(struct ConfigSubset **ptr)
Free a Config Subset.
Definition: subset.c:93
ConfigScope
Who does this Config belong to?
Definition: subset.h:36
const struct ConfigSubset * sub
Config Subset.
Definition: subset.h:72
const char * name
Name of config item that changed.
Definition: subset.h:73