summaryrefslogtreecommitdiff
path: root/src/fundamental
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-25 15:58:02 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-25 16:02:25 +0200
commitf90ee9ff6638ff5125d2aafe066fd5cc8e46932f (patch)
treec6766320945e191df1cc1f42769f2bcdf5d3a185 /src/fundamental
parentc20b2f2421011a2c29fa04cc1955ed67b87daeb2 (diff)
downloadsystemd-f90ee9ff6638ff5125d2aafe066fd5cc8e46932f.tar.gz
basic: add helper function to print </==/>
Diffstat (limited to 'src/fundamental')
-rw-r--r--src/fundamental/string-util-fundamental.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fundamental/string-util-fundamental.h b/src/fundamental/string-util-fundamental.h
index 101c2ae1b6..01df4ce17a 100644
--- a/src/fundamental/string-util-fundamental.h
+++ b/src/fundamental/string-util-fundamental.h
@@ -76,6 +76,10 @@ static inline const sd_char *yes_no(sd_bool b) {
return b ? STR_C("yes") : STR_C("no");
}
+static inline const sd_char* comparison_operator(int result) {
+ return result < 0 ? STR_C("<") : result > 0 ? STR_C(">") : STR_C("==");
+}
+
sd_int strverscmp_improved(const sd_char *a, const sd_char *b);
/* Like startswith(), but operates on arbitrary memory blocks */