forked from external/yambar
modules: don't assume module content is a dictionary
This is done by having each module implement a top-level verifier function.
This commit is contained in:
parent
e471c2357d
commit
9944a8f972
13 changed files with 146 additions and 56 deletions
18
modules/i3.c
18
modules/i3.c
|
@ -701,14 +701,22 @@ verify_content(keychain_t *chain, const struct yml_node *node)
|
|||
return true;
|
||||
}
|
||||
|
||||
const struct module_info plugin_info = {
|
||||
.from_conf = &from_conf,
|
||||
.attrs = {
|
||||
static bool
|
||||
verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||
{
|
||||
static const struct attr_info attrs[] = {
|
||||
{"spacing", false, &conf_verify_int},
|
||||
{"left-spacing", false, &conf_verify_int},
|
||||
{"right-spacing", false, &conf_verify_int},
|
||||
{"content", true, &verify_content},
|
||||
{"anchors", false, NULL},
|
||||
{NULL, false, NULL},
|
||||
},
|
||||
{NULL, false, NULL}
|
||||
};
|
||||
|
||||
return conf_verify_dict(chain, node, attrs);
|
||||
}
|
||||
|
||||
const struct module_info plugin_info = {
|
||||
.verify_conf = &verify_conf,
|
||||
.from_conf = &from_conf,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue