From: Sam Leonard Date: Thu, 2 Nov 2023 11:43:05 +0000 (+0000) Subject: string-util: add on_off X-Git-Tag: v255-rc1~31^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35dab95cdd9571e1896a05188c88f5187c4a7efb;p=thirdparty%2Fsystemd.git string-util: add on_off --- diff --git a/src/fundamental/string-util-fundamental.h b/src/fundamental/string-util-fundamental.h index 9019542b169..b537b2e31c7 100644 --- a/src/fundamental/string-util-fundamental.h +++ b/src/fundamental/string-util-fundamental.h @@ -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("=="); }