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
This commit is contained in:
Lennart Poettering
2015-11-03 17:45:11 +01:00
parent b11d6a7bed
commit a0f29c767a
14 changed files with 32 additions and 20 deletions
+15
View File
@@ -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
-15
View File
@@ -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
+1
View File
@@ -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"
+1
View File
@@ -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"
+1
View File
@@ -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"
+1
View File
@@ -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"
+1
View File
@@ -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"
+1
View File
@@ -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"
+1
View File
@@ -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"
+2 -1
View File
@@ -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)
+1
View File
@@ -28,6 +28,7 @@
#include <string.h>
#include "conf-files.h"
#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "hashmap.h"
+3 -2
View File
@@ -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',
+3 -2
View File
@@ -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;
+1
View File
@@ -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"