Subset of config items. More...
#include "config.h"
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "subset.h"
#include "set.h"
Go to the source code of this file.
Functions | |
int | elem_list_sort (const void *a, const void *b, void *sdata) |
Compare two HashElem pointers to config - Implements sort_t -. | |
struct HashElem ** | get_elem_list (struct ConfigSet *cs) |
Create a sorted list of all config items. | |
void | cs_subset_free (struct ConfigSubset **ptr) |
Free a Config Subset. | |
struct ConfigSubset * | cs_subset_new (const char *name, struct ConfigSubset *sub_parent, struct Notify *not_parent) |
Create a new Config Subset. | |
struct HashElem * | cs_subset_lookup (const struct ConfigSubset *sub, const char *name) |
Find an inherited config item. | |
struct HashElem * | cs_subset_create_inheritance (const struct ConfigSubset *sub, const char *name) |
Create a Subset config item (inherited) | |
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_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_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_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. | |
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_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_delete (const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *err) |
Delete config item from a config. | |
Variables | |
static const struct Mapping | ConfigEventNames [] |
Names for logging. | |
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.c.
Create a sorted list of all config items.
cs | ConfigSet to read |
ptr | Null-terminated array of HashElem |
Definition at line 79 of file subset.c.
void cs_subset_free | ( | struct ConfigSubset ** | ptr | ) |
Free a Config Subset.
ptr | Subset to free |
Definition at line 108 of file subset.c.
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 152 of file subset.c.
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 187 of file subset.c.
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 208 of file subset.c.
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 237 of file subset.c.
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 258 of file subset.c.
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 275 of file subset.c.
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 297 of file subset.c.
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 312 of file subset.c.
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 332 of file subset.c.
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 348 of file subset.c.
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 364 of file subset.c.
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 386 of file subset.c.
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 402 of file subset.c.
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 424 of file subset.c.
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 445 of file subset.c.
|
static |
Names for logging.