struct HashElem *child =
mutt_hash_typed_insert(cs->hash, cdef->name, cdef->type, (void *) cdef);
if (!child)
- return NULL;
+ return NULL; /* LCOV_EXCL_LINE */
cdef->var = parent;
return child;
struct HashElem *he =
mutt_hash_typed_insert(cs->hash, cdef->name, cdef->type, (void *) cdef);
if (!he)
- return NULL;
+ return NULL; /* LCOV_EXCL_LINE */
if (cst && cst->reset)
cst->reset(cs, cdef->var, cdef, err);
void cs_init(struct ConfigSet *cs, size_t size)
{
if (!cs)
- return; /* LCOV_EXCL_LINE */
+ return;
memset(cs, 0, sizeof(*cs));
cs->hash = mutt_hash_new(size, MUTT_HASH_NO_FLAGS);
void cs_free(struct ConfigSet **cs)
{
if (!cs || !*cs)
- return; /* LCOV_EXCL_LINE */
+ return;
mutt_hash_free(&(*cs)->hash);
FREE(cs);
struct HashElem *cs_get_elem(const struct ConfigSet *cs, const char *name)
{
if (!cs || !name)
- return NULL; /* LCOV_EXCL_LINE */
+ return NULL;
struct HashElem *he = mutt_hash_find_elem(cs->hash, name);
if (!he)
const struct ConfigSetType *cs_get_type_def(const struct ConfigSet *cs, unsigned int type)
{
if (!cs)
- return NULL; /* LCOV_EXCL_LINE */
+ return NULL;
type = DTYPE(type);
if ((type < 1) || (type >= mutt_array_size(cs->types)))
bool cs_register_type(struct ConfigSet *cs, unsigned int type, const struct ConfigSetType *cst)
{
if (!cs || !cst)
- return false; /* LCOV_EXCL_LINE */
+ return false;
if (!cst->name || !cst->string_set || !cst->string_get || !cst->reset ||
!cst->native_set || !cst->native_get)
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], int flags)
{
if (!cs || !vars)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct Buffer *err = mutt_buffer_pool_get();
struct HashElem *parent, const char *name)
{
if (!cs || !parent)
- return NULL; /* LCOV_EXCL_LINE */
+ return NULL;
struct Inheritance *i = mutt_mem_calloc(1, sizeof(*i));
i->parent = parent;
void cs_add_listener(struct ConfigSet *cs, cs_listener fn)
{
if (!cs || !fn)
- return; /* LCOV_EXCL_LINE */
+ return;
for (size_t i = 0; i < mutt_array_size(cs->listeners); i++)
{
void cs_remove_listener(struct ConfigSet *cs, cs_listener fn)
{
if (!cs || !fn)
- return; /* LCOV_EXCL_LINE */
+ return;
for (size_t i = 0; i < mutt_array_size(cs->listeners); i++)
{
const char *name, enum ConfigEvent ev)
{
if (!cs || !he || !name)
- return; /* LCOV_EXCL_LINE */
+ return;
for (size_t i = 0; i < mutt_array_size(cs->listeners); i++)
{
int cs_he_reset(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
{
if (!cs || !he)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
/* An inherited var that's already pointing to its parent.
* Return 'success', but don't send a notification. */
int cs_str_reset(const struct ConfigSet *cs, const char *name, struct Buffer *err)
{
if (!cs || !name)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct HashElem *he = cs_get_elem(cs, name);
if (!he)
const char *value, struct Buffer *err)
{
if (!cs || !he)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct ConfigDef *cdef = NULL;
const struct ConfigSetType *cst = NULL;
const char *value, struct Buffer *err)
{
if (!cs || !name)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct HashElem *he = cs_get_elem(cs, name);
if (!he)
int cs_he_initial_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
{
if (!cs || !he)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct Inheritance *i = NULL;
const struct ConfigDef *cdef = NULL;
int cs_str_initial_get(const struct ConfigSet *cs, const char *name, struct Buffer *result)
{
if (!cs || !name)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct HashElem *he = cs_get_elem(cs, name);
if (!he)
const char *value, struct Buffer *err)
{
if (!cs || !he)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct ConfigDef *cdef = NULL;
const struct ConfigSetType *cst = NULL;
}
if (!var)
- return CSR_ERR_CODE;
+ return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
int rc = cst->string_set(cs, var, cdef, value, err);
if (CSR_RESULT(rc) != CSR_SUCCESS)
const char *value, struct Buffer *err)
{
if (!cs || !name)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct HashElem *he = cs_get_elem(cs, name);
if (!he)
int cs_he_string_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
{
if (!cs || !he)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct Inheritance *i = NULL;
const struct ConfigDef *cdef = NULL;
int cs_str_string_get(const struct ConfigSet *cs, const char *name, struct Buffer *result)
{
if (!cs || !name)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct HashElem *he = cs_get_elem(cs, name);
if (!he)
intptr_t value, struct Buffer *err)
{
if (!cs || !he)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
const struct ConfigDef *cdef = NULL;
const struct ConfigSetType *cst = NULL;
intptr_t value, struct Buffer *err)
{
if (!cs || !name)
- return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
+ return CSR_ERR_CODE;
struct HashElem *he = cs_get_elem(cs, name);
if (!he)
}
if (!cst)
- {
- mutt_debug(LL_DEBUG1, "Variable '%s' has an invalid type %d\n", cdef->name, he->type);
- return CSR_ERR_CODE;
- }
+ return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
int rc = cst->native_set(cs, var, cdef, value, err);
if (CSR_RESULT(rc) == CSR_SUCCESS)
intptr_t cs_he_native_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
{
if (!cs || !he)
- return INT_MIN; /* LCOV_EXCL_LINE */
+ return INT_MIN;
struct Inheritance *i = NULL;
const struct ConfigDef *cdef = NULL;
intptr_t cs_str_native_get(const struct ConfigSet *cs, const char *name, struct Buffer *err)
{
if (!cs || !name)
- return INT_MIN; /* LCOV_EXCL_LINE */
+ return INT_MIN;
struct HashElem *he = cs_get_elem(cs, name);
return cs_he_native_get(cs, he, err);