]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
string-util: add on_off
authorSam Leonard <sam.leonard@codethink.co.uk>
Thu, 2 Nov 2023 11:43:05 +0000 (11:43 +0000)
committerSam Leonard <sam.leonard@codethink.co.uk>
Thu, 2 Nov 2023 15:37:40 +0000 (15:37 +0000)
src/fundamental/string-util-fundamental.h

index 9019542b169c3058e200afb78fb87329cdd527b7..b537b2e31c738d559c0ebfcc4e5c39e729a0dcbf 100644 (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("==");
 }