summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-03 12:26:12 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-03 17:45:11 +0100
commita0f29c767a3bb3d621c658fa5b87063e1f44e24a (patch)
tree4d56b28633fc5349826ca4cb90049f3854b4cdd7 /src
parentb11d6a7bed4d867fb9f6ff4e7eb4ab20fcdc9301 (diff)
util-lib: move CONF_DIRS_NULSTR definition to def.h
After all, this is not some compiler or C magic, but something very specific to how systemd works, hence let's move it into def.h, and out of macro.h
Diffstat (limited to 'src')
-rw-r--r--src/basic/def.h15
-rw-r--r--src/basic/macro.h15
-rw-r--r--src/binfmt/binfmt.c1
-rw-r--r--src/bootchart/bootchart.c1
-rw-r--r--src/journal-remote/journal-remote.c1
-rw-r--r--src/journal-remote/journal-upload.c1
-rw-r--r--src/login/logind.c1
-rw-r--r--src/modules-load/modules-load.c1
-rw-r--r--src/resolve/resolved-conf.c1
-rw-r--r--src/shared/sleep-config.c3
-rw-r--r--src/sysctl/sysctl.c1
-rw-r--r--src/sysusers/sysusers.c5
-rw-r--r--src/timesync/timesyncd-conf.c5
-rw-r--r--src/tmpfiles/tmpfiles.c1
14 files changed, 32 insertions, 20 deletions
diff --git a/src/basic/def.h b/src/basic/def.h
index b33f9ae76a..950f693899 100644
--- a/src/basic/def.h
+++ b/src/basic/def.h
@@ -75,3 +75,18 @@
#define NOTIFY_FD_MAX 768
#define NOTIFY_BUFFER_MAX PIPE_BUF
+
+/* Return a nulstr for a standard cascade of configuration directories,
+ * suitable to pass to conf_files_list_nulstr or config_parse_many. */
+#define CONF_DIRS_NULSTR(n) \
+ "/etc/" n ".d\0" \
+ "/run/" n ".d\0" \
+ "/usr/local/lib/" n ".d\0" \
+ "/usr/lib/" n ".d\0" \
+ CONF_DIR_SPLIT_USR(n)
+
+#ifdef HAVE_SPLIT_USR
+#define CONF_DIR_SPLIT_USR(n) "/lib/" n ".d\0"
+#else
+#define CONF_DIR_SPLIT_USR(n)
+#endif
diff --git a/src/basic/macro.h b/src/basic/macro.h
index daa7c416f7..5088e6720d 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -334,21 +334,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
_found; \
})
-/* Return a nulstr for a standard cascade of configuration directories,
- * suitable to pass to conf_files_list_nulstr or config_parse_many. */
-#define CONF_DIRS_NULSTR(n) \
- "/etc/" n ".d\0" \
- "/run/" n ".d\0" \
- "/usr/local/lib/" n ".d\0" \
- "/usr/lib/" n ".d\0" \
- CONF_DIR_SPLIT_USR(n)
-
-#ifdef HAVE_SPLIT_USR
-#define CONF_DIR_SPLIT_USR(n) "/lib/" n ".d\0"
-#else
-#define CONF_DIR_SPLIT_USR(n)
-#endif
-
/* Define C11 thread_local attribute even on older gcc compiler
* version */
#ifndef thread_local
diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
index 8e63153c92..594c9ebe43 100644
--- a/src/binfmt/binfmt.c
+++ b/src/binfmt/binfmt.c
@@ -29,6 +29,7 @@
#include "alloc-util.h"
#include "conf-files.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 6723fa5098..852febb225 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -51,6 +51,7 @@
#include "alloc-util.h"
#include "bootchart.h"
#include "conf-parser.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "io-util.h"
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index dc69bb8679..6326f902e8 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -37,6 +37,7 @@
#include "alloc-util.h"
#include "conf-parser.h"
+#include "def.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index 7d274d2fc9..42d14dc7c4 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -29,6 +29,7 @@
#include "alloc-util.h"
#include "conf-parser.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
diff --git a/src/login/logind.c b/src/login/logind.c
index 4b8c834269..d1e2ea2489 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -31,6 +31,7 @@
#include "bus-error.h"
#include "bus-util.h"
#include "conf-parser.h"
+#include "def.h"
#include "dirent-util.h"
#include "fd-util.h"
#include "formats-util.h"
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
index 830ca7b89d..b90c50719f 100644
--- a/src/modules-load/modules-load.c
+++ b/src/modules-load/modules-load.c
@@ -27,6 +27,7 @@
#include <sys/stat.h>
#include "conf-files.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c
index c9919ced67..42e3be3168 100644
--- a/src/resolve/resolved-conf.c
+++ b/src/resolve/resolved-conf.c
@@ -21,6 +21,7 @@
#include "alloc-util.h"
#include "conf-parser.h"
+#include "def.h"
#include "extract-word.h"
#include "parse-util.h"
#include "resolved-conf.h"
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index bbbb3460d4..102c5cc992 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -23,14 +23,15 @@
#include "alloc-util.h"
#include "conf-parser.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
+#include "parse-util.h"
#include "sleep-config.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
-#include "parse-util.h"
#define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0)
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 5e15dfba53..24cfe58cd6 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -28,6 +28,7 @@
#include <string.h>
#include "conf-files.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "hashmap.h"
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 36d310b4c4..9a1c88d08e 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -29,6 +29,8 @@
#include "alloc-util.h"
#include "conf-files.h"
#include "copy.h"
+#include "def.h"
+#include "fd-util.h"
#include "fileio-label.h"
#include "formats-util.h"
#include "hashmap.h"
@@ -39,10 +41,9 @@
#include "string-util.h"
#include "strv.h"
#include "uid-range.h"
+#include "user-util.h"
#include "utf8.h"
#include "util.h"
-#include "fd-util.h"
-#include "user-util.h"
typedef enum ItemType {
ADD_USER = 'u',
diff --git a/src/timesync/timesyncd-conf.c b/src/timesync/timesyncd-conf.c
index be651fc636..001a0f4d41 100644
--- a/src/timesync/timesyncd-conf.c
+++ b/src/timesync/timesyncd-conf.c
@@ -20,11 +20,12 @@
***/
#include "alloc-util.h"
+#include "def.h"
+#include "extract-word.h"
#include "string-util.h"
+#include "timesyncd-conf.h"
#include "timesyncd-manager.h"
#include "timesyncd-server.h"
-#include "timesyncd-conf.h"
-#include "extract-word.h"
int manager_parse_server_string(Manager *m, ServerType type, const char *string) {
ServerName *first;
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 45335425ce..ffae91a3ca 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -45,6 +45,7 @@
#include "chattr-util.h"
#include "conf-files.h"
#include "copy.h"
+#include "def.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"