mirror of
https://github.com/labwc/labwc.git
synced 2026-02-26 01:40:22 -05:00
src/common/parse-bool.c: support on/off boolean values
This commit is contained in:
parent
bd6efe4849
commit
143714f1c9
2 changed files with 10 additions and 0 deletions
|
|
@ -94,6 +94,12 @@ Elements at the same level can have the same name whereas attributes cannot.
|
|||
Therefore, where multiple objects of the same kind are required (for example
|
||||
*<action>* and *<keybind>*) the top-node of the object has to be an element.
|
||||
|
||||
## BOOLEANS
|
||||
|
||||
Note that in this manual, Boolean values are listed as [yes|no] for simplicity,
|
||||
but it's also possible to use [true|false] and\/or [on|off];
|
||||
this is for compatibility with Openbox.
|
||||
|
||||
## CORE
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -13,10 +13,14 @@ parse_bool(const char *str, int default_value)
|
|||
return true;
|
||||
} else if (!strcasecmp(str, "true")) {
|
||||
return true;
|
||||
} else if (!strcasecmp(str, "on")) {
|
||||
return true;
|
||||
} else if (!strcasecmp(str, "no")) {
|
||||
return false;
|
||||
} else if (!strcasecmp(str, "false")) {
|
||||
return false;
|
||||
} else if (!strcasecmp(str, "off")) {
|
||||
return false;
|
||||
}
|
||||
error_not_a_boolean:
|
||||
wlr_log(WLR_ERROR, "(%s) is not a boolean value", str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue