Subset of Config Items. More...
Include dependency graph for subset.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | ConfigSubset |
| A set of inherited config items. More... | |
| struct | EventConfig |
| A config-change event. More... | |
Enumerations | |
| enum | ConfigScope { SET_SCOPE_NEOMUTT , SET_SCOPE_ACCOUNT , SET_SCOPE_MAILBOX } |
| Who does this Config belong to? More... | |
| enum | NotifyConfig { NT_CONFIG_SET = 1 , NT_CONFIG_RESET , NT_CONFIG_DELETED } |
| Config notification types. More... | |
| enum | GetElemListFlags { GEL_ALL_CONFIG , GEL_CHANGED_CONFIG } |
| Flags for get_elem_list() More... | |
Functions | |
| 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. | |
| struct HashElem * | cs_subset_create_inheritance (const struct ConfigSubset *sub, const char *name) |
| Create a Subset config item (inherited) | |
| 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. | |
| 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_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_he_reset (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err) |
| Reset a config item to its initial value. | |
| 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_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_plus_equals (const struct ConfigSubset *sub, struct HashElem *he, const char *value, struct Buffer *err) |
| Add to a config item by 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_he_delete (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err) |
| Delete config item from a config. | |
| 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. | |
| 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_str_string_set (const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err) |
| Set a config item by string. | |
| int | elem_list_sort (const void *a, const void *b, void *sdata) |
| Compare two HashElem pointers to config - Implements sort_t -. | |
| struct HashElemArray | get_elem_list (struct ConfigSet *cs, enum GetElemListFlags flags) |
| Create a sorted list of all config items. | |
Subset of Config Items.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file subset.h.
| enum ConfigScope |
| enum NotifyConfig |
Config notification types.
Observers of NT_CONFIG will be passed an EventConfig.
| Enumerator | |
|---|---|
| NT_CONFIG_SET | Config item has been set. |
| NT_CONFIG_RESET | Config item has been reset to initial, or parent, value. |
| NT_CONFIG_DELETED | Config item has been deleted. |
Definition at line 59 of file subset.h.
| enum GetElemListFlags |
Flags for get_elem_list()
| Enumerator | |
|---|---|
| GEL_ALL_CONFIG | All the normal config (no synonyms or deprecated) |
| GEL_CHANGED_CONFIG | Only config that has been changed. |
Definition at line 79 of file subset.h.
| struct ConfigSubset * cs_subset_new | ( | const char * | name, |
| struct ConfigSubset * | sub_parent, | ||
| struct Notify * | not_parent ) |
Create a new Config Subset.
| name | Name for this Subset |
| sub_parent | Parent Subset |
| not_parent | Parent Notification |
| ptr | New Subset |
Definition at line 158 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void cs_subset_free | ( | struct ConfigSubset ** | ptr | ) |
Free a Config Subset.
| ptr | Subset to free |
Definition at line 112 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct HashElem * cs_subset_create_inheritance | ( | const struct ConfigSubset * | sub, |
| const char * | name ) |
Create a Subset config item (inherited)
| sub | Config Subset |
| name | Name of config item |
| ptr | HashElem of the config item |
| NULL | Error |
Definition at line 214 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct HashElem * cs_subset_lookup | ( | const struct ConfigSubset * | sub, |
| const char * | name ) |
Find an inherited config item.
| sub | Subset to search |
| name | Name of Config item to find |
| ptr | HashElem of the config item |
Definition at line 193 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void cs_subset_notify_observers | ( | const struct ConfigSubset * | sub, |
| struct HashElem * | he, | ||
| enum NotifyConfig | ev ) |
Notify all observers of an event.
| sub | Config Subset |
| he | HashElem representing config item |
| ev | Type of event |
Definition at line 243 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| intptr_t | Native pointer/value |
| INT_MIN | Error |
Definition at line 264 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| sub | Config Subset |
| he | HashElem representing config item |
| value | Native pointer/value to set |
| err | Buffer for error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 281 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int cs_subset_he_reset | ( | const struct ConfigSubset * | sub, |
| struct HashElem * | he, | ||
| struct Buffer * | err ) |
Reset a config item to its initial value.
| num | Result, e.g. CSR_SUCCESS |
Definition at line 318 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int cs_subset_he_string_get | ( | const struct ConfigSubset * | sub, |
| struct HashElem * | he, | ||
| struct Buffer * | result ) |
Get a config item as a string.
| sub | Config Subset |
| he | HashElem representing config item |
| result | Buffer for results or error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 338 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| sub | Config Subset |
| he | HashElem representing config item |
| value | Value to set |
| err | Buffer for error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 430 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| sub | Config Subset |
| he | HashElem representing config item |
| value | Value to set |
| err | Buffer for error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 408 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| sub | Config Subset |
| he | HashElem representing config item |
| value | Value to set |
| err | Buffer for error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 370 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int cs_subset_he_delete | ( | const struct ConfigSubset * | sub, |
| struct HashElem * | he, | ||
| struct Buffer * | err ) |
Delete config item from a config.
| num | Result, e.g. CSR_SUCCESS |
Definition at line 451 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| sub | Config Subset |
| name | Name of config item |
| value | Native pointer/value to set |
| err | Buffer for error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 303 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int cs_subset_str_string_get | ( | const struct ConfigSubset * | sub, |
| const char * | name, | ||
| struct Buffer * | result ) |
Get a config item as a string.
| sub | Config Subset |
| name | Name of config item |
| result | Buffer for results or error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 354 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| sub | Config Subset |
| name | Name of config item |
| value | Value to set |
| err | Buffer for error messages |
| num | Result, e.g. CSR_SUCCESS |
Definition at line 392 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct HashElemArray get_elem_list | ( | struct ConfigSet * | cs, |
| enum GetElemListFlags | flags ) |
Create a sorted list of all config items.
| cs | ConfigSet to read |
| flags | Flags, e.g. GEL_ALL_CONFIG |
| ptr | Array of HashElem |
Definition at line 81 of file subset.c.
Here is the call graph for this function:
Here is the caller graph for this function: