NeoMutt  2021-02-05-666-ge300cd
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 {
64 };
65 
70 {
71  const struct ConfigSubset *sub;
72  const char *name;
73  struct HashElem *he;
74 };
75 
76 struct ConfigSubset *cs_subset_new (const char *name, struct ConfigSubset *sub_parent, struct Notify *not_parent);
77 void cs_subset_free(struct ConfigSubset **ptr);
78 
79 struct HashElem *cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name);
80 struct HashElem *cs_subset_lookup (const struct ConfigSubset *sub, const char *name);
81 void cs_subset_notify_observers (const struct ConfigSubset *sub, struct HashElem *he, enum NotifyConfig ev);
82 
83 intptr_t cs_subset_he_native_get (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err);
84 int cs_subset_he_native_set (const struct ConfigSubset *sub, struct HashElem *he, intptr_t value, struct Buffer *err);
85 int cs_subset_he_reset (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err);
86 int cs_subset_he_string_get (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result);
87 int cs_subset_he_string_minus_equals (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err);
88 int cs_subset_he_string_plus_equals (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err);
89 int cs_subset_he_string_set (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err);
90 
91 intptr_t cs_subset_str_native_get (const struct ConfigSubset *sub, const char *name, struct Buffer *err);
92 int cs_subset_str_native_set (const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err);
93 int cs_subset_str_reset (const struct ConfigSubset *sub, const char *name, struct Buffer *err);
94 int cs_subset_str_string_get (const struct ConfigSubset *sub, const char *name, struct Buffer *result);
95 int cs_subset_str_string_minus_equals(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err);
96 int cs_subset_str_string_plus_equals (const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err);
97 int cs_subset_str_string_set (const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err);
98 
99 int elem_list_sort(const void *a, const void *b);
100 struct HashElem **get_elem_list(struct ConfigSet *cs);
101 
102 #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:283
Container for lots of config items.
Definition: set.h:259
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:305
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
Definition: subset.c:179
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:408
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:229
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:424
struct HashElem ** get_elem_list(struct ConfigSet *cs)
Create a sorted list of all config items.
Definition: subset.c:75
A config-change event.
Definition: subset.h:69
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:250
struct HashElem * cs_subset_create_inheritance(const struct ConfigSubset *sub, const char *name)
Create a Subset config item (inherited)
Definition: subset.c:200
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:267
struct ConfigSet * cs
Parent ConfigSet.
Definition: subset.h:51
struct HashElem * he
Config item that changed.
Definition: subset.h:73
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:386
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:320
int elem_list_sort(const void *a, const void *b)
Sort two HashElem pointers to config.
Definition: subset.c:59
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:354
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:462
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
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:144
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:340
This Config is Account-specific.
Definition: subset.h:39
Notification API.
Definition: notify.c:50
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:484
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:370
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:446
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:104
ConfigScope
Who does this Config belong to?
Definition: subset.h:36
const struct ConfigSubset * sub
Config Subset.
Definition: subset.h:71
const char * name
Name of config item that changed.
Definition: subset.h:72