string-util: add on_off

This commit is contained in:
Sam Leonard 2023-11-02 11:43:05 +00:00
parent e8ac916ec3
commit 35dab95cdd
No known key found for this signature in database
GPG key ID: 96850F0978CE78F0

View file

@ -74,6 +74,10 @@ static inline const sd_char *yes_no(bool b) {
return b ? STR_C("yes") : STR_C("no");
}
static inline const sd_char *on_off(bool b) {
return b ? STR_C("on") : STR_C("off");
}
static inline const sd_char* comparison_operator(int result) {
return result < 0 ? STR_C("<") : result > 0 ? STR_C(">") : STR_C("==");
}