mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-20 03:35:41 +02:00
config-verify: add conf_verify_bool()
This commit is contained in:
parent
74016d7d33
commit
1c6c73928b
2 changed files with 12 additions and 0 deletions
|
@ -50,6 +50,17 @@ conf_verify_int(keychain_t *chain, const struct yml_node *node)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
conf_verify_bool(keychain_t *chain, const struct yml_node *node)
|
||||
{
|
||||
if (yml_value_is_bool(node))
|
||||
return true;
|
||||
|
||||
LOG_ERR("%s: value is not a boolean: '%s'",
|
||||
conf_err_prefix(chain, node), yml_value_as_string(node));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
conf_verify_list(keychain_t *chain, const struct yml_node *node,
|
||||
bool (*verify)(keychain_t *chain, const struct yml_node *node))
|
||||
|
|
|
@ -32,6 +32,7 @@ const char *conf_err_prefix(
|
|||
|
||||
bool conf_verify_string(keychain_t *chain, const struct yml_node *node);
|
||||
bool conf_verify_int(keychain_t *chain, const struct yml_node *node);
|
||||
bool conf_verify_bool(keychain_t *chain, const struct yml_node *node);
|
||||
|
||||
bool conf_verify_enum(keychain_t *chain, const struct yml_node *node,
|
||||
const char *values[], size_t count);
|
||||
|
|
Loading…
Add table
Reference in a new issue