]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: move yes_no() and friends to string-util.h
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Aug 2019 11:10:49 +0000 (13:10 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 16 Sep 2019 16:06:20 +0000 (18:06 +0200)
src/basic/string-util.h
src/basic/util.h
src/nspawn/test-patch-uid.c
src/shared/serialize.h
src/test/test-capability.c

index 76767afcac49a2e5ab89212f3a8b8fd81f1f2724..3981129db3180d7794ca99c62ad3a9ab638fcf29 100644 (file)
@@ -45,6 +45,22 @@ static inline const char *strna(const char *s) {
         return s ?: "n/a";
 }
 
+static inline const char* yes_no(bool b) {
+        return b ? "yes" : "no";
+}
+
+static inline const char* true_false(bool b) {
+        return b ? "true" : "false";
+}
+
+static inline const char* one_zero(bool b) {
+        return b ? "1" : "0";
+}
+
+static inline const char* enable_disable(bool b) {
+        return b ? "enable" : "disable";
+}
+
 static inline bool isempty(const char *p) {
         return !p || !p[0];
 }
index 25e6ab81127d1049fac5d451ee9f658cfa285d01..6fc7480fcbd7697b6101832f301a766f78dbd03d 100644 (file)
@@ -5,22 +5,6 @@
 
 #include "macro.h"
 
-static inline const char* yes_no(bool b) {
-        return b ? "yes" : "no";
-}
-
-static inline const char* true_false(bool b) {
-        return b ? "true" : "false";
-}
-
-static inline const char* one_zero(bool b) {
-        return b ? "1" : "0";
-}
-
-static inline const char* enable_disable(bool b) {
-        return b ? "enable" : "disable";
-}
-
 extern int saved_argc;
 extern char **saved_argv;
 
index b50f0990d842d5044e0baf3c734ea0a8c17107d1..a6829629b49c8c59ee95c62d8b3e2f0ee9ad0d7e 100644 (file)
@@ -5,8 +5,8 @@
 #include "log.h"
 #include "nspawn-patch-uid.h"
 #include "user-util.h"
+#include "string-util.h"
 #include "tests.h"
-#include "util.h"
 
 int main(int argc, char *argv[]) {
         uid_t shift, range;
index 8f4efc7996cc902838464e621a1530f5864b301b..9e61c825aa95ebc1feceb4e0bc2cf91d1fea7cdb 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "fdset.h"
 #include "macro.h"
+#include "string-util.h"
 #include "time-util.h"
 
 int serialize_item(FILE *f, const char *key, const char *value);
index f9fae84ddeacb14c97883dc875f5163b660dff43..84a6e92df1ddc457ed62e24cfead11137e1543b2 100644 (file)
@@ -15,8 +15,8 @@
 #include "macro.h"
 #include "missing_prctl.h"
 #include "parse-util.h"
+#include "string-util.h"
 #include "tests.h"
-#include "util.h"
 
 static uid_t test_uid = -1;
 static gid_t test_gid = -1;