parse-bool.c: add helpers to set bool/int iff valid boolean

This commit is contained in:
Johan Malm 2023-04-26 20:34:48 +01:00
parent 86cb62ed12
commit 1159947d09
3 changed files with 47 additions and 82 deletions

View file

@ -13,4 +13,12 @@
*/
int parse_bool(const char *str, int default_value);
/**
* set_bool() - Parse boolean text and set variable iff text is valid boolean
* @string: Boolean text to interpret.
* @variable: Variable to set.
*/
void set_bool(const char *str, bool *variable);
void set_bool_as_int(const char *str, int *variable);
#endif /* __LABWC_PARSE_BOOL_H */