diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-03 12:25:29 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-03 17:45:11 +0100 |
commit | b11d6a7bed4d867fb9f6ff4e7eb4ab20fcdc9301 (patch) | |
tree | d724afc2b5b4c81a87d68f4f5a8f46ea11789d61 | |
parent | 5703176d6e9680c32caac1de2d6bdb84cdc72c96 (diff) |
util-lib: move character class definitions to string-util.h
-rw-r--r-- | src/basic/cpu-set-util.c | 1 | ||||
-rw-r--r-- | src/basic/def.h | 6 | ||||
-rw-r--r-- | src/basic/escape.c | 1 | ||||
-rw-r--r-- | src/basic/extract-word.c | 3 | ||||
-rw-r--r-- | src/basic/glob-util.c | 1 | ||||
-rw-r--r-- | src/basic/glob-util.h | 2 | ||||
-rw-r--r-- | src/basic/replace-var.c | 4 | ||||
-rw-r--r-- | src/basic/string-util.c | 2 | ||||
-rw-r--r-- | src/basic/string-util.h | 12 | ||||
-rw-r--r-- | src/basic/util.h | 7 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp-lease.c | 3 |
11 files changed, 23 insertions, 19 deletions
diff --git a/src/basic/cpu-set-util.c b/src/basic/cpu-set-util.c index 4950c66767..e2ec4ca83f 100644 --- a/src/basic/cpu-set-util.c +++ b/src/basic/cpu-set-util.c @@ -24,6 +24,7 @@ #include "cpu-set-util.h" #include "extract-word.h" #include "parse-util.h" +#include "string-util.h" #include "util.h" cpu_set_t* cpu_set_malloc(unsigned *ncpus) { diff --git a/src/basic/def.h b/src/basic/def.h index cbef137410..b33f9ae76a 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -43,12 +43,6 @@ #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT #define SIGNALS_IGNORE SIGPIPE -#define DIGITS "0123456789" -#define LOWERCASE_LETTERS "abcdefghijklmnopqrstuvwxyz" -#define UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -#define LETTERS LOWERCASE_LETTERS UPPERCASE_LETTERS -#define ALPHANUMERICAL LETTERS DIGITS - #define REBOOT_PARAM_FILE "/run/systemd/reboot-param" #ifdef HAVE_SPLIT_USR diff --git a/src/basic/escape.c b/src/basic/escape.c index add0d7795b..4815161b09 100644 --- a/src/basic/escape.c +++ b/src/basic/escape.c @@ -22,6 +22,7 @@ #include "alloc-util.h" #include "escape.h" #include "hexdecoct.h" +#include "string-util.h" #include "utf8.h" #include "util.h" diff --git a/src/basic/extract-word.c b/src/basic/extract-word.c index c0f9394fad..6721b85c0a 100644 --- a/src/basic/extract-word.c +++ b/src/basic/extract-word.c @@ -21,9 +21,10 @@ #include "alloc-util.h" #include "escape.h" +#include "extract-word.h" +#include "string-util.h" #include "utf8.h" #include "util.h" -#include "extract-word.h" int extract_first_word(const char **p, char **ret, const char *separators, ExtractFlags flags) { _cleanup_free_ char *s = NULL; diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c index 112c6392e5..0bfbcb1d37 100644 --- a/src/basic/glob-util.c +++ b/src/basic/glob-util.c @@ -22,6 +22,7 @@ #include <glob.h> #include "glob-util.h" +#include "string-util.h" #include "strv.h" #include "util.h" diff --git a/src/basic/glob-util.h b/src/basic/glob-util.h index 8817df14b4..793adf4a6c 100644 --- a/src/basic/glob-util.h +++ b/src/basic/glob-util.h @@ -24,7 +24,7 @@ #include <string.h> #include "macro.h" -#include "util.h" +#include "string-util.h" int glob_exists(const char *path); int glob_extend(char ***strv, const char *path); diff --git a/src/basic/replace-var.c b/src/basic/replace-var.c index 18b49a9227..bf757cbc48 100644 --- a/src/basic/replace-var.c +++ b/src/basic/replace-var.c @@ -23,9 +23,9 @@ #include "alloc-util.h" #include "macro.h" -#include "util.h" #include "replace-var.h" -#include "def.h" +#include "string-util.h" +#include "util.h" /* * Generic infrastructure for replacing @FOO@ style variables in diff --git a/src/basic/string-util.c b/src/basic/string-util.c index c3be576816..6006767daa 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -21,9 +21,9 @@ #include "alloc-util.h" #include "gunicode.h" +#include "string-util.h" #include "utf8.h" #include "util.h" -#include "string-util.h" int strcmp_ptr(const char *a, const char *b) { diff --git a/src/basic/string-util.h b/src/basic/string-util.h index 15244b8184..54f9d3058c 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -26,6 +26,18 @@ #include "macro.h" +/* What is interpreted as whitespace? */ +#define WHITESPACE " \t\n\r" +#define NEWLINE "\n\r" +#define QUOTES "\"\'" +#define COMMENTS "#;" +#define GLOB_CHARS "*?[" +#define DIGITS "0123456789" +#define LOWERCASE_LETTERS "abcdefghijklmnopqrstuvwxyz" +#define UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +#define LETTERS LOWERCASE_LETTERS UPPERCASE_LETTERS +#define ALPHANUMERICAL LETTERS DIGITS + #define streq(a,b) (strcmp((a),(b)) == 0) #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) #define strcaseeq(a,b) (strcasecmp((a),(b)) == 0) diff --git a/src/basic/util.h b/src/basic/util.h index a8fba372d1..d9d2f72b75 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -44,13 +44,6 @@ #include "missing.h" #include "time-util.h" -/* What is interpreted as whitespace? */ -#define WHITESPACE " \t\n\r" -#define NEWLINE "\n\r" -#define QUOTES "\"\'" -#define COMMENTS "#;" -#define GLOB_CHARS "*?[" - size_t page_size(void) _pure_; #define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index c850538d74..42dd15fc15 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -32,11 +32,12 @@ #include "dns-domain.h" #include "fd-util.h" #include "fileio.h" +#include "hexdecoct.h" #include "hostname-util.h" #include "in-addr-util.h" #include "network-internal.h" -#include "hexdecoct.h" #include "parse-util.h" +#include "string-util.h" #include "unaligned.h" int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) { |