]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2015 15:18:16 +0000 (16:18 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 12:25:55 +0000 (13:25 +0100)
136 files changed:
Makefile.am
src/analyze/analyze.c
src/backlight/backlight.c
src/basic/audit.c
src/basic/cap-list.c
src/basic/capability.c
src/basic/cgroup-util.c
src/basic/cpu-set-util.c
src/basic/fd-util.c
src/basic/fdset.c
src/basic/log.c
src/basic/parse-util.c [new file with mode: 0644]
src/basic/parse-util.h [new file with mode: 0644]
src/basic/path-util.c
src/basic/signal-util.c
src/basic/signal-util.h
src/basic/socket-util.c
src/basic/terminal-util.c
src/basic/user-util.c
src/basic/util.c
src/basic/util.h
src/bootchart/bootchart.c
src/bootchart/store.c
src/cgtop/cgtop.c
src/core/automount.c
src/core/busname.c
src/core/cgroup.c
src/core/dbus-execute.c
src/core/device.c
src/core/execute.c
src/core/job.c
src/core/killall.c
src/core/load-fragment.c
src/core/main.c
src/core/manager.c
src/core/mount.c
src/core/service.c
src/core/show-status.c
src/core/shutdown.c
src/core/snapshot.c
src/core/snapshot.h
src/core/socket.c
src/core/swap.c
src/core/timer.c
src/core/unit.c
src/cryptsetup/cryptsetup-generator.c
src/cryptsetup/cryptsetup.c
src/debug-generator/debug-generator.c
src/delta/delta.c
src/firstboot/firstboot.c
src/fsck/fsck.c
src/fstab-generator/fstab-generator.c
src/gpt-auto-generator/gpt-auto-generator.c
src/hostname/hostnamed.c
src/import/importd.c
src/import/pull-job.c
src/import/pull.c
src/journal-remote/journal-gatewayd.c
src/journal-remote/journal-remote-parse.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload.c
src/journal/cat.c
src/journal/coredump.c
src/journal/coredumpctl.c
src/journal/journal-file.c
src/journal/journal-vacuum.c
src/journal/journalctl.c
src/journal/journald-console.c
src/journal/journald-kmsg.c
src/journal/journald-native.c
src/journal/journald-server.c
src/journal/journald-stream.c
src/journal/test-compress-benchmark.c
src/journal/test-journal-init.c
src/journal/test-journal-interleaving.c
src/journal/test-journal-stream.c
src/libsystemd-network/network-internal.c
src/libsystemd-network/sd-dhcp-lease.c
src/libsystemd-network/test-ipv4ll-manual.c
src/libsystemd/sd-bus/bus-creds.c
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/busctl.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-daemon/sd-daemon.c
src/libsystemd/sd-device/device-private.c
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-login/sd-login.c
src/libsystemd/sd-network/sd-network.c
src/libudev/libudev-device.c
src/login/loginctl.c
src/login/logind-inhibit.c
src/login/logind-seat.c
src/login/logind-session.c
src/login/logind-user.c
src/login/pam_systemd.c
src/machine/machine.c
src/machine/machinectl.c
src/network/networkctl.c
src/network/networkd-address.c
src/network/networkd-link-bus.c
src/network/networkd-netdev-tunnel.c
src/network/networkd-network.c
src/network/networkd-route.c
src/network/networkd-util.c
src/notify/notify.c
src/nspawn/nspawn-expose-ports.c
src/nspawn/nspawn-mount.c
src/nspawn/nspawn.c
src/resolve-host/resolve-host.c
src/resolve/resolved-conf.c
src/resolve/resolved-link.c
src/resolve/resolved-manager.c
src/rfkill/rfkill.c
src/run/run.c
src/shared/apparmor-util.c
src/shared/bus-util.c
src/shared/condition.c
src/shared/conf-parser.c
src/shared/dns-domain.c
src/shared/efivars.c
src/shared/fstab-util.c
src/shared/logs-show.c
src/shared/machine-pool.c
src/shared/sleep-config.c
src/systemctl/systemctl.c
src/test/test-btrfs.c
src/test/test-cap-list.c
src/test/test-cgroup-util.c
src/test/test-fileio.c
src/test/test-util.c
src/timedate/timedatectl.c
src/tmpfiles/tmpfiles.c
src/udev/net/link-config.c
src/udev/udev-builtin-keyboard.c
src/udev/udevadm-settle.c
src/udev/udevd.c

index 2e960623a53825385adedcd1aabd0781349d9115..189d9c99ac6a1200c86e13f1122119f79f372d8e 100644 (file)
@@ -787,6 +787,8 @@ libbasic_la_SOURCES = \
        src/basic/string-util.h \
        src/basic/fd-util.c \
        src/basic/fd-util.h \
+       src/basic/parse-util.c \
+       src/basic/parse-util.h \
        src/basic/user-util.c \
        src/basic/user-util.h \
        src/basic/extract-word.c \
index 4bf83eb3293546e27a2926b41fd74439643928ea..6ba16d8b65ef45f2531e1dd4469bad18203fc167 100644 (file)
@@ -33,6 +33,7 @@
 #include "hashmap.h"
 #include "log.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "special.h"
 #include "strv.h"
 #include "strxcpyx.h"
index fc96eee6a92edb3350d9f9772e5fa4a69d1ac9a3..6a2d04ef13f88cfe34f5b064ea1b43e5a10009b0 100644 (file)
@@ -28,6 +28,7 @@
 #include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
+#include "parse-util.h"
 
 static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) {
         struct udev_device *parent;
index c9b762151a2c038a1af789cd2228e41df85e48f5..4957fc1bec15376b26a42a769aeacc6dcdabd559 100644 (file)
@@ -26,6 +26,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "user-util.h"
 #include "util.h"
index bd5bffbfa519479a207a4a2ef5744aab80c75e3a..4d391510bc8a254333d9ff5fc67a02a3fc92f274 100644 (file)
 
 #include <string.h>
 
-#include "util.h"
 #include "cap-list.h"
 #include "missing.h"
+#include "parse-util.h"
+#include "util.h"
 
 static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
 
index 6f25b5dee943dd3ad875282859c8ae4beb1650f8..04c7047a6af9795c3df88eddb7bc836aba6f0766 100644 (file)
@@ -30,6 +30,7 @@
 #include "fileio.h"
 #include "log.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "util.h"
 
 int have_effective_cap(int value) {
index 4af991200c8c6a7c0177eb1bebac03a2faea5ccf..232d6e8fe24ebfb45e5c90eef537f31b55ce038b 100644 (file)
@@ -37,6 +37,7 @@
 #include "login-util.h"
 #include "macro.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "set.h"
index 5e064d854fad5726fc438880e01e272ee3061610..cbeae0bf20ab82a1effcf09c78e539cb8f65922a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "cpu-set-util.h"
 #include "extract-word.h"
+#include "parse-util.h"
 #include "util.h"
-#include "cpu-set-util.h"
 
 cpu_set_t* cpu_set_malloc(unsigned *ncpus) {
         cpu_set_t *c;
index e54c104597ecd5212162add4ddbb4a1eddc6b100..76d7e32bfa10cee5d2af23ddcd2674beab454204 100644 (file)
@@ -20,6 +20,7 @@
 ***/
 
 #include "fd-util.h"
+#include "parse-util.h"
 #include "util.h"
 
 int close_nointr(int fd) {
index 96691108283d3c9052bdc284f04e731ba2c7db44..ef60f664313bec4c49997c4578a28d1e5b98889a 100644 (file)
@@ -28,6 +28,7 @@
 #include "fd-util.h"
 #include "fdset.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "set.h"
 #include "util.h"
 
index 99dccb1f103cf83c8288611006121068357cd4a8..2c0abdc0bdcefb027654195cbde529d6e39b0270 100644 (file)
@@ -42,6 +42,7 @@
 #include "string-util.h"
 #include "terminal-util.h"
 #include "util.h"
+#include "parse-util.h"
 
 #define SNDBUF_SIZE (8*1024*1024)
 
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
new file mode 100644 (file)
index 0000000..2437fee
--- /dev/null
@@ -0,0 +1,408 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "parse-util.h"
+#include "string-util.h"
+#include "util.h"
+
+int parse_boolean(const char *v) {
+        assert(v);
+
+        if (streq(v, "1") || strcaseeq(v, "yes") || strcaseeq(v, "y") || strcaseeq(v, "true") || strcaseeq(v, "t") || strcaseeq(v, "on"))
+                return 1;
+        else if (streq(v, "0") || strcaseeq(v, "no") || strcaseeq(v, "n") || strcaseeq(v, "false") || strcaseeq(v, "f") || strcaseeq(v, "off"))
+                return 0;
+
+        return -EINVAL;
+}
+
+int parse_pid(const char *s, pid_t* ret_pid) {
+        unsigned long ul = 0;
+        pid_t pid;
+        int r;
+
+        assert(s);
+        assert(ret_pid);
+
+        r = safe_atolu(s, &ul);
+        if (r < 0)
+                return r;
+
+        pid = (pid_t) ul;
+
+        if ((unsigned long) pid != ul)
+                return -ERANGE;
+
+        if (pid <= 0)
+                return -ERANGE;
+
+        *ret_pid = pid;
+        return 0;
+}
+
+int parse_mode(const char *s, mode_t *ret) {
+        char *x;
+        long l;
+
+        assert(s);
+        assert(ret);
+
+        errno = 0;
+        l = strtol(s, &x, 8);
+        if (errno != 0)
+                return -errno;
+
+        if (!x || x == s || *x)
+                return -EINVAL;
+        if (l < 0 || l  > 07777)
+                return -ERANGE;
+
+        *ret = (mode_t) l;
+        return 0;
+}
+
+int parse_size(const char *t, uint64_t base, uint64_t *size) {
+
+        /* Soo, sometimes we want to parse IEC binary suffixes, and
+         * sometimes SI decimal suffixes. This function can parse
+         * both. Which one is the right way depends on the
+         * context. Wikipedia suggests that SI is customary for
+         * hardware metrics and network speeds, while IEC is
+         * customary for most data sizes used by software and volatile
+         * (RAM) memory. Hence be careful which one you pick!
+         *
+         * In either case we use just K, M, G as suffix, and not Ki,
+         * Mi, Gi or so (as IEC would suggest). That's because that's
+         * frickin' ugly. But this means you really need to make sure
+         * to document which base you are parsing when you use this
+         * call. */
+
+        struct table {
+                const char *suffix;
+                unsigned long long factor;
+        };
+
+        static const struct table iec[] = {
+                { "E", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
+                { "P", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
+                { "T", 1024ULL*1024ULL*1024ULL*1024ULL },
+                { "G", 1024ULL*1024ULL*1024ULL },
+                { "M", 1024ULL*1024ULL },
+                { "K", 1024ULL },
+                { "B", 1ULL },
+                { "",  1ULL },
+        };
+
+        static const struct table si[] = {
+                { "E", 1000ULL*1000ULL*1000ULL*1000ULL*1000ULL*1000ULL },
+                { "P", 1000ULL*1000ULL*1000ULL*1000ULL*1000ULL },
+                { "T", 1000ULL*1000ULL*1000ULL*1000ULL },
+                { "G", 1000ULL*1000ULL*1000ULL },
+                { "M", 1000ULL*1000ULL },
+                { "K", 1000ULL },
+                { "B", 1ULL },
+                { "",  1ULL },
+        };
+
+        const struct table *table;
+        const char *p;
+        unsigned long long r = 0;
+        unsigned n_entries, start_pos = 0;
+
+        assert(t);
+        assert(base == 1000 || base == 1024);
+        assert(size);
+
+        if (base == 1000) {
+                table = si;
+                n_entries = ELEMENTSOF(si);
+        } else {
+                table = iec;
+                n_entries = ELEMENTSOF(iec);
+        }
+
+        p = t;
+        do {
+                unsigned long long l, tmp;
+                double frac = 0;
+                char *e;
+                unsigned i;
+
+                p += strspn(p, WHITESPACE);
+                if (*p == '-')
+                        return -ERANGE;
+
+                errno = 0;
+                l = strtoull(p, &e, 10);
+                if (errno > 0)
+                        return -errno;
+                if (e == p)
+                        return -EINVAL;
+
+                if (*e == '.') {
+                        e++;
+
+                        /* strtoull() itself would accept space/+/- */
+                        if (*e >= '0' && *e <= '9') {
+                                unsigned long long l2;
+                                char *e2;
+
+                                l2 = strtoull(e, &e2, 10);
+                                if (errno > 0)
+                                        return -errno;
+
+                                /* Ignore failure. E.g. 10.M is valid */
+                                frac = l2;
+                                for (; e < e2; e++)
+                                        frac /= 10;
+                        }
+                }
+
+                e += strspn(e, WHITESPACE);
+
+                for (i = start_pos; i < n_entries; i++)
+                        if (startswith(e, table[i].suffix))
+                                break;
+
+                if (i >= n_entries)
+                        return -EINVAL;
+
+                if (l + (frac > 0) > ULLONG_MAX / table[i].factor)
+                        return -ERANGE;
+
+                tmp = l * table[i].factor + (unsigned long long) (frac * table[i].factor);
+                if (tmp > ULLONG_MAX - r)
+                        return -ERANGE;
+
+                r += tmp;
+                if ((unsigned long long) (uint64_t) r != r)
+                        return -ERANGE;
+
+                p = e + strlen(table[i].suffix);
+
+                start_pos = i + 1;
+
+        } while (*p);
+
+        *size = r;
+
+        return 0;
+}
+
+char *format_bytes(char *buf, size_t l, uint64_t t) {
+        unsigned i;
+
+        /* This only does IEC units so far */
+
+        static const struct {
+                const char *suffix;
+                uint64_t factor;
+        } table[] = {
+                { "E", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
+                { "P", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
+                { "T", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
+                { "G", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
+                { "M", UINT64_C(1024)*UINT64_C(1024) },
+                { "K", UINT64_C(1024) },
+        };
+
+        if (t == (uint64_t) -1)
+                return NULL;
+
+        for (i = 0; i < ELEMENTSOF(table); i++) {
+
+                if (t >= table[i].factor) {
+                        snprintf(buf, l,
+                                 "%" PRIu64 ".%" PRIu64 "%s",
+                                 t / table[i].factor,
+                                 ((t*UINT64_C(10)) / table[i].factor) % UINT64_C(10),
+                                 table[i].suffix);
+
+                        goto finish;
+                }
+        }
+
+        snprintf(buf, l, "%" PRIu64 "B", t);
+
+finish:
+        buf[l-1] = 0;
+        return buf;
+
+}
+
+int safe_atou(const char *s, unsigned *ret_u) {
+        char *x = NULL;
+        unsigned long l;
+
+        assert(s);
+        assert(ret_u);
+
+        errno = 0;
+        l = strtoul(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno > 0 ? -errno : -EINVAL;
+
+        if ((unsigned long) (unsigned) l != l)
+                return -ERANGE;
+
+        *ret_u = (unsigned) l;
+        return 0;
+}
+
+int safe_atoi(const char *s, int *ret_i) {
+        char *x = NULL;
+        long l;
+
+        assert(s);
+        assert(ret_i);
+
+        errno = 0;
+        l = strtol(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno > 0 ? -errno : -EINVAL;
+
+        if ((long) (int) l != l)
+                return -ERANGE;
+
+        *ret_i = (int) l;
+        return 0;
+}
+
+int safe_atollu(const char *s, long long unsigned *ret_llu) {
+        char *x = NULL;
+        unsigned long long l;
+
+        assert(s);
+        assert(ret_llu);
+
+        errno = 0;
+        l = strtoull(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno ? -errno : -EINVAL;
+
+        *ret_llu = l;
+        return 0;
+}
+
+int safe_atolli(const char *s, long long int *ret_lli) {
+        char *x = NULL;
+        long long l;
+
+        assert(s);
+        assert(ret_lli);
+
+        errno = 0;
+        l = strtoll(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno ? -errno : -EINVAL;
+
+        *ret_lli = l;
+        return 0;
+}
+
+int safe_atou8(const char *s, uint8_t *ret) {
+        char *x = NULL;
+        unsigned long l;
+
+        assert(s);
+        assert(ret);
+
+        errno = 0;
+        l = strtoul(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno > 0 ? -errno : -EINVAL;
+
+        if ((unsigned long) (uint8_t) l != l)
+                return -ERANGE;
+
+        *ret = (uint8_t) l;
+        return 0;
+}
+
+int safe_atou16(const char *s, uint16_t *ret) {
+        char *x = NULL;
+        unsigned long l;
+
+        assert(s);
+        assert(ret);
+
+        errno = 0;
+        l = strtoul(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno > 0 ? -errno : -EINVAL;
+
+        if ((unsigned long) (uint16_t) l != l)
+                return -ERANGE;
+
+        *ret = (uint16_t) l;
+        return 0;
+}
+
+int safe_atoi16(const char *s, int16_t *ret) {
+        char *x = NULL;
+        long l;
+
+        assert(s);
+        assert(ret);
+
+        errno = 0;
+        l = strtol(s, &x, 0);
+
+        if (!x || x == s || *x || errno)
+                return errno > 0 ? -errno : -EINVAL;
+
+        if ((long) (int16_t) l != l)
+                return -ERANGE;
+
+        *ret = (int16_t) l;
+        return 0;
+}
+
+int safe_atod(const char *s, double *ret_d) {
+        char *x = NULL;
+        double d = 0;
+        locale_t loc;
+
+        assert(s);
+        assert(ret_d);
+
+        loc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
+        if (loc == (locale_t) 0)
+                return -errno;
+
+        errno = 0;
+        d = strtod_l(s, &x, loc);
+
+        if (!x || x == s || *x || errno) {
+                freelocale(loc);
+                return errno ? -errno : -EINVAL;
+        }
+
+        freelocale(loc);
+        *ret_d = (double) d;
+        return 0;
+}
diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h
new file mode 100644 (file)
index 0000000..35b4ba0
--- /dev/null
@@ -0,0 +1,88 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <inttypes.h>
+#include <sys/types.h>
+
+#include "macro.h"
+
+int parse_boolean(const char *v) _pure_;
+int parse_pid(const char *s, pid_t* ret_pid);
+int parse_mode(const char *s, mode_t *ret);
+
+int parse_size(const char *t, uint64_t base, uint64_t *size);
+
+#define FORMAT_BYTES_MAX 8
+char *format_bytes(char *buf, size_t l, uint64_t t);
+
+int safe_atou(const char *s, unsigned *ret_u);
+int safe_atoi(const char *s, int *ret_i);
+int safe_atollu(const char *s, unsigned long long *ret_u);
+int safe_atolli(const char *s, long long int *ret_i);
+
+int safe_atou8(const char *s, uint8_t *ret);
+
+int safe_atou16(const char *s, uint16_t *ret);
+int safe_atoi16(const char *s, int16_t *ret);
+
+static inline int safe_atou32(const char *s, uint32_t *ret_u) {
+        assert_cc(sizeof(uint32_t) == sizeof(unsigned));
+        return safe_atou(s, (unsigned*) ret_u);
+}
+
+static inline int safe_atoi32(const char *s, int32_t *ret_i) {
+        assert_cc(sizeof(int32_t) == sizeof(int));
+        return safe_atoi(s, (int*) ret_i);
+}
+
+static inline int safe_atou64(const char *s, uint64_t *ret_u) {
+        assert_cc(sizeof(uint64_t) == sizeof(unsigned long long));
+        return safe_atollu(s, (unsigned long long*) ret_u);
+}
+
+static inline int safe_atoi64(const char *s, int64_t *ret_i) {
+        assert_cc(sizeof(int64_t) == sizeof(long long int));
+        return safe_atolli(s, (long long int*) ret_i);
+}
+
+#if LONG_MAX == INT_MAX
+static inline int safe_atolu(const char *s, unsigned long *ret_u) {
+        assert_cc(sizeof(unsigned long) == sizeof(unsigned));
+        return safe_atou(s, (unsigned*) ret_u);
+}
+static inline int safe_atoli(const char *s, long int *ret_u) {
+        assert_cc(sizeof(long int) == sizeof(int));
+        return safe_atoi(s, (int*) ret_u);
+}
+#else
+static inline int safe_atolu(const char *s, unsigned long *ret_u) {
+        assert_cc(sizeof(unsigned long) == sizeof(unsigned long long));
+        return safe_atollu(s, (unsigned long long*) ret_u);
+}
+static inline int safe_atoli(const char *s, long int *ret_u) {
+        assert_cc(sizeof(long int) == sizeof(long long int));
+        return safe_atolli(s, (long long int*) ret_u);
+}
+#endif
+
+int safe_atod(const char *s, double *ret_d);
index e25e50e78a65313ec51140ab4e986c53adaf7091..0015667ac0954d24ae2c0acfbce142aaa20455d9 100644 (file)
@@ -32,6 +32,7 @@
 #include "log.h"
 #include "macro.h"
 #include "missing.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "string-util.h"
 #include "strv.h"
index 730f99e0af4fe7ab80e14c5d7d3d96aea701dcfc..e5ac6317d404e37965d809914e76f634986f9c8e 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "parse-util.h"
+#include "signal-util.h"
 #include "string-util.h"
 #include "util.h"
 
-#include "signal-util.h"
-
 int reset_all_signal_handlers(void) {
         static const struct sigaction sa = {
                 .sa_handler = SIG_DFL,
@@ -268,3 +268,7 @@ int signal_from_string_try_harder(const char *s) {
 
         return signo;
 }
+
+void nop_signal_handler(int sig) {
+        /* nothing here */
+}
index 5e6eb50b07f53ebabdf3d545c5896c5b54bfe6de..e7393e2dacaf2157cf7a34d621bca306ebc85897 100644 (file)
@@ -39,3 +39,5 @@ const char *signal_to_string(int i) _const_;
 int signal_from_string(const char *s) _pure_;
 
 int signal_from_string_try_harder(const char *s);
+
+void nop_signal_handler(int sig);
index 684ac765f5adb5f82ce461e45f598c33eb2a51ca..c4af6aa9410a161ed17d214705f0e6ffcb19b3ea 100644 (file)
@@ -35,6 +35,7 @@
 #include "formats-util.h"
 #include "macro.h"
 #include "missing.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "socket-util.h"
 #include "string-util.h"
index 7dfab0af62088af9f5ac21acc5c42a7b45448ca9..2fe5c26a6722a10a25ed2a22303a04f1ad9b7cd6 100644 (file)
@@ -34,6 +34,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "io-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "socket-util.h"
index 7e6c4c645da2e5183cf510585e48f18dbf8bf8cf..0b3cf3d733bea4554543b080a0a6d76fd3141191 100644 (file)
 #include <pwd.h>
 #include <grp.h>
 
-#include "user-util.h"
 #include "macro.h"
-#include "util.h"
-#include "string-util.h"
+#include "parse-util.h"
 #include "path-util.h"
+#include "string-util.h"
+#include "user-util.h"
+#include "util.h"
 
 bool uid_is_valid(uid_t uid) {
 
index d5227aa6d0d68ab446e2e4e46973bf1e92fca98a..66b7978c60b2949d4d70c09d5c03c4ac259a5736 100644 (file)
@@ -89,6 +89,7 @@
 #include "macro.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "random-util.h"
@@ -133,201 +134,6 @@ int unlink_noerrno(const char *path) {
         return 0;
 }
 
-int parse_boolean(const char *v) {
-        assert(v);
-
-        if (streq(v, "1") || strcaseeq(v, "yes") || strcaseeq(v, "y") || strcaseeq(v, "true") || strcaseeq(v, "t") || strcaseeq(v, "on"))
-                return 1;
-        else if (streq(v, "0") || strcaseeq(v, "no") || strcaseeq(v, "n") || strcaseeq(v, "false") || strcaseeq(v, "f") || strcaseeq(v, "off"))
-                return 0;
-
-        return -EINVAL;
-}
-
-int parse_pid(const char *s, pid_t* ret_pid) {
-        unsigned long ul = 0;
-        pid_t pid;
-        int r;
-
-        assert(s);
-        assert(ret_pid);
-
-        r = safe_atolu(s, &ul);
-        if (r < 0)
-                return r;
-
-        pid = (pid_t) ul;
-
-        if ((unsigned long) pid != ul)
-                return -ERANGE;
-
-        if (pid <= 0)
-                return -ERANGE;
-
-        *ret_pid = pid;
-        return 0;
-}
-
-int safe_atou(const char *s, unsigned *ret_u) {
-        char *x = NULL;
-        unsigned long l;
-
-        assert(s);
-        assert(ret_u);
-
-        errno = 0;
-        l = strtoul(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno > 0 ? -errno : -EINVAL;
-
-        if ((unsigned long) (unsigned) l != l)
-                return -ERANGE;
-
-        *ret_u = (unsigned) l;
-        return 0;
-}
-
-int safe_atoi(const char *s, int *ret_i) {
-        char *x = NULL;
-        long l;
-
-        assert(s);
-        assert(ret_i);
-
-        errno = 0;
-        l = strtol(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno > 0 ? -errno : -EINVAL;
-
-        if ((long) (int) l != l)
-                return -ERANGE;
-
-        *ret_i = (int) l;
-        return 0;
-}
-
-int safe_atou8(const char *s, uint8_t *ret) {
-        char *x = NULL;
-        unsigned long l;
-
-        assert(s);
-        assert(ret);
-
-        errno = 0;
-        l = strtoul(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno > 0 ? -errno : -EINVAL;
-
-        if ((unsigned long) (uint8_t) l != l)
-                return -ERANGE;
-
-        *ret = (uint8_t) l;
-        return 0;
-}
-
-int safe_atou16(const char *s, uint16_t *ret) {
-        char *x = NULL;
-        unsigned long l;
-
-        assert(s);
-        assert(ret);
-
-        errno = 0;
-        l = strtoul(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno > 0 ? -errno : -EINVAL;
-
-        if ((unsigned long) (uint16_t) l != l)
-                return -ERANGE;
-
-        *ret = (uint16_t) l;
-        return 0;
-}
-
-int safe_atoi16(const char *s, int16_t *ret) {
-        char *x = NULL;
-        long l;
-
-        assert(s);
-        assert(ret);
-
-        errno = 0;
-        l = strtol(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno > 0 ? -errno : -EINVAL;
-
-        if ((long) (int16_t) l != l)
-                return -ERANGE;
-
-        *ret = (int16_t) l;
-        return 0;
-}
-
-int safe_atollu(const char *s, long long unsigned *ret_llu) {
-        char *x = NULL;
-        unsigned long long l;
-
-        assert(s);
-        assert(ret_llu);
-
-        errno = 0;
-        l = strtoull(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno ? -errno : -EINVAL;
-
-        *ret_llu = l;
-        return 0;
-}
-
-int safe_atolli(const char *s, long long int *ret_lli) {
-        char *x = NULL;
-        long long l;
-
-        assert(s);
-        assert(ret_lli);
-
-        errno = 0;
-        l = strtoll(s, &x, 0);
-
-        if (!x || x == s || *x || errno)
-                return errno ? -errno : -EINVAL;
-
-        *ret_lli = l;
-        return 0;
-}
-
-int safe_atod(const char *s, double *ret_d) {
-        char *x = NULL;
-        double d = 0;
-        locale_t loc;
-
-        assert(s);
-        assert(ret_d);
-
-        loc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
-        if (loc == (locale_t) 0)
-                return -errno;
-
-        errno = 0;
-        d = strtod_l(s, &x, loc);
-
-        if (!x || x == s || *x || errno) {
-                freelocale(loc);
-                return errno ? -errno : -EINVAL;
-        }
-
-        freelocale(loc);
-        *ret_d = (double) d;
-        return 0;
-}
-
-
 int fchmod_umask(int fd, mode_t m) {
         mode_t u;
         int r;
@@ -1195,134 +1001,6 @@ bool fstype_is_network(const char *fstype) {
         return nulstr_contains(table, fstype);
 }
 
-int parse_size(const char *t, uint64_t base, uint64_t *size) {
-
-        /* Soo, sometimes we want to parse IEC binary suffixes, and
-         * sometimes SI decimal suffixes. This function can parse
-         * both. Which one is the right way depends on the
-         * context. Wikipedia suggests that SI is customary for
-         * hardware metrics and network speeds, while IEC is
-         * customary for most data sizes used by software and volatile
-         * (RAM) memory. Hence be careful which one you pick!
-         *
-         * In either case we use just K, M, G as suffix, and not Ki,
-         * Mi, Gi or so (as IEC would suggest). That's because that's
-         * frickin' ugly. But this means you really need to make sure
-         * to document which base you are parsing when you use this
-         * call. */
-
-        struct table {
-                const char *suffix;
-                unsigned long long factor;
-        };
-
-        static const struct table iec[] = {
-                { "E", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
-                { "P", 1024ULL*1024ULL*1024ULL*1024ULL*1024ULL },
-                { "T", 1024ULL*1024ULL*1024ULL*1024ULL },
-                { "G", 1024ULL*1024ULL*1024ULL },
-                { "M", 1024ULL*1024ULL },
-                { "K", 1024ULL },
-                { "B", 1ULL },
-                { "",  1ULL },
-        };
-
-        static const struct table si[] = {
-                { "E", 1000ULL*1000ULL*1000ULL*1000ULL*1000ULL*1000ULL },
-                { "P", 1000ULL*1000ULL*1000ULL*1000ULL*1000ULL },
-                { "T", 1000ULL*1000ULL*1000ULL*1000ULL },
-                { "G", 1000ULL*1000ULL*1000ULL },
-                { "M", 1000ULL*1000ULL },
-                { "K", 1000ULL },
-                { "B", 1ULL },
-                { "",  1ULL },
-        };
-
-        const struct table *table;
-        const char *p;
-        unsigned long long r = 0;
-        unsigned n_entries, start_pos = 0;
-
-        assert(t);
-        assert(base == 1000 || base == 1024);
-        assert(size);
-
-        if (base == 1000) {
-                table = si;
-                n_entries = ELEMENTSOF(si);
-        } else {
-                table = iec;
-                n_entries = ELEMENTSOF(iec);
-        }
-
-        p = t;
-        do {
-                unsigned long long l, tmp;
-                double frac = 0;
-                char *e;
-                unsigned i;
-
-                p += strspn(p, WHITESPACE);
-                if (*p == '-')
-                        return -ERANGE;
-
-                errno = 0;
-                l = strtoull(p, &e, 10);
-                if (errno > 0)
-                        return -errno;
-                if (e == p)
-                        return -EINVAL;
-
-                if (*e == '.') {
-                        e++;
-
-                        /* strtoull() itself would accept space/+/- */
-                        if (*e >= '0' && *e <= '9') {
-                                unsigned long long l2;
-                                char *e2;
-
-                                l2 = strtoull(e, &e2, 10);
-                                if (errno > 0)
-                                        return -errno;
-
-                                /* Ignore failure. E.g. 10.M is valid */
-                                frac = l2;
-                                for (; e < e2; e++)
-                                        frac /= 10;
-                        }
-                }
-
-                e += strspn(e, WHITESPACE);
-
-                for (i = start_pos; i < n_entries; i++)
-                        if (startswith(e, table[i].suffix))
-                                break;
-
-                if (i >= n_entries)
-                        return -EINVAL;
-
-                if (l + (frac > 0) > ULLONG_MAX / table[i].factor)
-                        return -ERANGE;
-
-                tmp = l * table[i].factor + (unsigned long long) (frac * table[i].factor);
-                if (tmp > ULLONG_MAX - r)
-                        return -ERANGE;
-
-                r += tmp;
-                if ((unsigned long long) (uint64_t) r != r)
-                        return -ERANGE;
-
-                p = e + strlen(table[i].suffix);
-
-                start_pos = i + 1;
-
-        } while (*p);
-
-        *size = r;
-
-        return 0;
-}
-
 bool is_device_path(const char *path) {
 
         /* Returns true on paths that refer to a device, either in
@@ -2300,45 +1978,6 @@ int prot_from_flags(int flags) {
         }
 }
 
-char *format_bytes(char *buf, size_t l, uint64_t t) {
-        unsigned i;
-
-        static const struct {
-                const char *suffix;
-                uint64_t factor;
-        } table[] = {
-                { "E", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
-                { "P", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
-                { "T", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
-                { "G", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
-                { "M", UINT64_C(1024)*UINT64_C(1024) },
-                { "K", UINT64_C(1024) },
-        };
-
-        if (t == (uint64_t) -1)
-                return NULL;
-
-        for (i = 0; i < ELEMENTSOF(table); i++) {
-
-                if (t >= table[i].factor) {
-                        snprintf(buf, l,
-                                 "%" PRIu64 ".%" PRIu64 "%s",
-                                 t / table[i].factor,
-                                 ((t*UINT64_C(10)) / table[i].factor) % UINT64_C(10),
-                                 table[i].suffix);
-
-                        goto finish;
-                }
-        }
-
-        snprintf(buf, l, "%" PRIu64 "B", t);
-
-finish:
-        buf[l-1] = 0;
-        return buf;
-
-}
-
 void* memdup(const void *p, size_t l) {
         void *r;
 
@@ -4111,27 +3750,6 @@ int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char
         return 0;
 }
 
-int parse_mode(const char *s, mode_t *ret) {
-        char *x;
-        long l;
-
-        assert(s);
-        assert(ret);
-
-        errno = 0;
-        l = strtol(s, &x, 8);
-        if (errno != 0)
-                return -errno;
-
-        if (!x || x == s || *x)
-                return -EINVAL;
-        if (l < 0 || l  > 07777)
-                return -ERANGE;
-
-        *ret = (mode_t) l;
-        return 0;
-}
-
 int mount_move_root(const char *path) {
         assert(path);
 
@@ -4220,10 +3838,6 @@ int fgetxattr_malloc(int fd, const char *name, char **value) {
         }
 }
 
-void nop_signal_handler(int sig) {
-        /* nothing here */
-}
-
 int version(void) {
         puts(PACKAGE_STRING "\n"
              SYSTEMD_FEATURES);
index f32033767ae379ad1eeea762653f6b0ff2ed1711..d51b824294c6c3c0ecb89ee108d4321ffe4f4baa 100644 (file)
@@ -53,8 +53,6 @@
 #define COMMENTS   "#;"
 #define GLOB_CHARS "*?["
 
-#define FORMAT_BYTES_MAX 8
-
 size_t page_size(void) _pure_;
 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
 
@@ -87,64 +85,6 @@ static inline const char* one_zero(bool b) {
         return b ? "1" : "0";
 }
 
-int parse_size(const char *t, uint64_t base, uint64_t *size);
-
-int parse_boolean(const char *v) _pure_;
-int parse_pid(const char *s, pid_t* ret_pid);
-
-int safe_atou(const char *s, unsigned *ret_u);
-int safe_atoi(const char *s, int *ret_i);
-
-int safe_atollu(const char *s, unsigned long long *ret_u);
-int safe_atolli(const char *s, long long int *ret_i);
-
-int safe_atod(const char *s, double *ret_d);
-
-int safe_atou8(const char *s, uint8_t *ret);
-
-#if LONG_MAX == INT_MAX
-static inline int safe_atolu(const char *s, unsigned long *ret_u) {
-        assert_cc(sizeof(unsigned long) == sizeof(unsigned));
-        return safe_atou(s, (unsigned*) ret_u);
-}
-static inline int safe_atoli(const char *s, long int *ret_u) {
-        assert_cc(sizeof(long int) == sizeof(int));
-        return safe_atoi(s, (int*) ret_u);
-}
-#else
-static inline int safe_atolu(const char *s, unsigned long *ret_u) {
-        assert_cc(sizeof(unsigned long) == sizeof(unsigned long long));
-        return safe_atollu(s, (unsigned long long*) ret_u);
-}
-static inline int safe_atoli(const char *s, long int *ret_u) {
-        assert_cc(sizeof(long int) == sizeof(long long int));
-        return safe_atolli(s, (long long int*) ret_u);
-}
-#endif
-
-static inline int safe_atou32(const char *s, uint32_t *ret_u) {
-        assert_cc(sizeof(uint32_t) == sizeof(unsigned));
-        return safe_atou(s, (unsigned*) ret_u);
-}
-
-static inline int safe_atoi32(const char *s, int32_t *ret_i) {
-        assert_cc(sizeof(int32_t) == sizeof(int));
-        return safe_atoi(s, (int*) ret_i);
-}
-
-static inline int safe_atou64(const char *s, uint64_t *ret_u) {
-        assert_cc(sizeof(uint64_t) == sizeof(unsigned long long));
-        return safe_atollu(s, (unsigned long long*) ret_u);
-}
-
-static inline int safe_atoi64(const char *s, int64_t *ret_i) {
-        assert_cc(sizeof(int64_t) == sizeof(long long int));
-        return safe_atolli(s, (long long int*) ret_i);
-}
-
-int safe_atou16(const char *s, uint16_t *ret);
-int safe_atoi16(const char *s, int16_t *ret);
-
 int readlinkat_malloc(int fd, const char *p, char **ret);
 int readlink_malloc(const char *p, char **r);
 int readlink_value(const char *p, char **ret);
@@ -336,8 +276,6 @@ bool kexec_loaded(void);
 
 int prot_from_flags(int flags) _const_;
 
-char *format_bytes(char *buf, size_t l, uint64_t t);
-
 void* memdup(const void *p, size_t l) _alloc_(2);
 
 int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *path, ...);
@@ -680,15 +618,11 @@ int syslog_parse_priority(const char **p, int *priority, bool with_facility);
 
 int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
 
-int parse_mode(const char *s, mode_t *ret);
-
 int mount_move_root(const char *path);
 
 int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink);
 int fgetxattr_malloc(int fd, const char *name, char **value);
 
-void nop_signal_handler(int sig);
-
 int version(void);
 
 bool fdname_is_valid(const char *s);
index ef113ed40c3e5ac6e34a36859a04b6a64cdf3ed1..c0019174ab8583c5214b411c5b9c1e0e89f970fd 100644 (file)
@@ -55,6 +55,7 @@
 #include "io-util.h"
 #include "list.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "store.h"
 #include "string-util.h"
index 6066e142886f2ba9121f5b9c2a455b3733769ac9..50b69637ef4af466693b3e8f7432867698a688ca 100644 (file)
@@ -35,6 +35,7 @@
 #include "cgroup-util.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "parse-util.h"
 #include "store.h"
 #include "string-util.h"
 #include "strxcpyx.h"
index 3786dae2d982b6dde86f0cdd986fbca6e1afdd4b..43b8af44203dc53faa264c700fabb45e712e1137 100644 (file)
@@ -36,6 +36,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "hashmap.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "terminal-util.h"
index d362d6579d923fff0482a9f877814869fd6a18e6..2ee32312fba8ac3e4772e99db9cc75756c6e3e1f 100644 (file)
@@ -40,6 +40,7 @@
 #include "label.h"
 #include "mkdir.h"
 #include "mount.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "special.h"
index 335a1fdc4c9efc96193ba89cf5c8d19dbc6421c2..df4a8bef52bb2e521acbf61e23331c9820b8a39c 100644 (file)
@@ -30,6 +30,7 @@
 #include "fd-util.h"
 #include "formats-util.h"
 #include "kdbus.h"
+#include "parse-util.h"
 #include "service.h"
 #include "signal-util.h"
 #include "special.h"
index 2a2cf02774d8be7b446eab86954447b148729ee6..a33eaa8d421a4287994fac228c6b7a5af82a52b6 100644 (file)
@@ -25,6 +25,7 @@
 #include "cgroup-util.h"
 #include "cgroup.h"
 #include "fd-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "special.h"
index 6f1e0dc6ac25e259a4c240d16a595d73290c9326..a7fbd711442c3d7192204bfa3da04e21229c222f 100644 (file)
 #include "ioprio.h"
 #include "missing.h"
 #include "namespace.h"
+#include "parse-util.h"
 #include "path-util.h"
-#include "strv.h"
-#include "utf8.h"
-
 #ifdef HAVE_SECCOMP
 #include "seccomp-util.h"
 #endif
+#include "strv.h"
+#include "utf8.h"
 
 BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput);
 
index 9127d2d225285e7d80f076a7ce7696cca5018bf4..fb467a48765bf3f68d299a65dd27f8285dccf353 100644 (file)
 #include "libudev.h"
 
 #include "dbus-device.h"
+#include "device.h"
 #include "log.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "string-util.h"
 #include "swap.h"
 #include "udev-util.h"
 #include "unit-name.h"
 #include "unit.h"
-#include "device.h"
 
 static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
         [DEVICE_DEAD] = UNIT_INACTIVE,
index 3f2607ff1a2537bc0a01838f615651d4e070205d..24a8e646ad6005d88dba807e21eb03931858886f 100644 (file)
@@ -76,6 +76,7 @@
 #include "missing.h"
 #include "mkdir.h"
 #include "namespace.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "rm-rf.h"
index 8a0e0a0ea41f768ae167bd54d18b8871ce53962b..7fde88f5fe58bf944a7be6ad3cabb47003849626 100644 (file)
 #include "dbus-job.h"
 #include "dbus.h"
 #include "escape.h"
+#include "job.h"
 #include "log.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "set.h"
 #include "special.h"
 #include "string-util.h"
@@ -37,7 +39,6 @@
 #include "terminal-util.h"
 #include "unit.h"
 #include "virt.h"
-#include "job.h"
 
 Job* job_new_raw(Unit *unit) {
         Job *j;
index cb11987166626f5e0b497869c1b0e4f0aa98fca8..dbfa90ebacb6f83565784bb99d8368e21d80ee43 100644 (file)
@@ -27,6 +27,7 @@
 #include "fd-util.h"
 #include "formats-util.h"
 #include "killall.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "set.h"
 #include "string-util.h"
index 31fdc48823e084eff9703c80efb783e27763eac8..f5c28e514f879c053b1a6bb4202be2968c769c17 100644 (file)
@@ -48,6 +48,7 @@
 #include "load-fragment.h"
 #include "log.h"
 #include "missing.h"
+#include "parse-util.h"
 #include "path-util.h"
 #ifdef HAVE_SECCOMP
 #include "seccomp-util.h"
index b0ca6fa10e0c77c4bc1b24b5e6405108afe9e93e..a8834b6f0b2db62b770aa2391520ca144b23da87 100644 (file)
@@ -67,6 +67,7 @@
 #include "missing.h"
 #include "mount-setup.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "selinux-setup.h"
 #include "selinux-util.h"
index 287676ff27023870963030fca278c5584135729c..9ad8a136abb326c1bf3861e0af126e193949e3a2 100644 (file)
@@ -62,6 +62,7 @@
 #include "manager.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-lookup.h"
 #include "path-util.h"
 #include "process-util.h"
index ebdb3503e9b50db521e82784ea97bcf1cdb186f8..59f56bdefa5db02b3366670689f04de38f01d877 100644 (file)
@@ -36,6 +36,7 @@
 #include "mkdir.h"
 #include "mount-setup.h"
 #include "mount.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "smack-util.h"
 #include "special.h"
index abcbd4954f181de77f3fe42798956ec1df0c5062..d5bd8869da705e08b8f6d345ebfd5efe1c7231c3 100644 (file)
@@ -39,6 +39,7 @@
 #include "load-fragment.h"
 #include "log.h"
 #include "manager.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "service.h"
index 7951ea73038d767ba349195001438f9479ba5f6e..9e4c9f563eff4621dc72f5a98fbfca5f01208c95 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "parse-util.h"
+#include "show-status.h"
 #include "string-util.h"
 #include "util.h"
-#include "show-status.h"
 
 int parse_show_status(const char *v, ShowStatus *ret) {
         int r;
index 33383a4b0bd562de1bd181ab851ed0e701108b66..93bbc315d36ac8e08fbe4268a2d57fcb76821a07 100644 (file)
@@ -37,6 +37,7 @@
 #include "killall.h"
 #include "log.h"
 #include "missing.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "switch-root.h"
index 15726c344e5c950f9192e1c0b9a46c834a92f375..da1c99ad12e0f05fcca724ee105784f14173a51c 100644 (file)
 
 #include "bus-common-errors.h"
 #include "dbus-snapshot.h"
+#include "parse-util.h"
+#include "parse-util.h"
+#include "snapshot.h"
 #include "string-util.h"
 #include "unit-name.h"
 #include "unit.h"
-#include "snapshot.h"
 
 static const UnitActiveState state_translation_table[_SNAPSHOT_STATE_MAX] = {
         [SNAPSHOT_DEAD] = UNIT_INACTIVE,
index 97747e18bdfd35cae3df9b41332de0fff2a6564f..bd52dea408b14c424f78698ed5f11b4ae16c4162 100644 (file)
@@ -23,6 +23,8 @@
 
 typedef struct Snapshot Snapshot;
 
+#include "unit.h"
+
 struct Snapshot {
         Unit meta;
 
index 7f401025ed5f58c78040f40bf5ea0a30acb1671d..49cef210dcb390a1a04f360e8bb485e2dc54368f 100644 (file)
@@ -43,6 +43,7 @@
 #include "log.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "selinux-util.h"
 #include "signal-util.h"
index d864c7b3041e0ac61f297175ad582d80633df321..c4151c6afdece483e1cb23057f4bdef6194f79b6 100644 (file)
@@ -32,6 +32,7 @@
 #include "fd-util.h"
 #include "formats-util.h"
 #include "fstab-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "special.h"
 #include "string-util.h"
index 908d45ac7397b0600c252b8961b358d9ba7b7396..3ece2e056d1461193a56ce22955ab046a8a9b56c 100644 (file)
@@ -24,6 +24,7 @@
 #include "bus-error.h"
 #include "bus-util.h"
 #include "dbus-timer.h"
+#include "parse-util.h"
 #include "special.h"
 #include "string-util.h"
 #include "timer.h"
index 572b1c1b784220023a484cfc09205c63bd63b12f..17c135cf3f857d9828aa951e8f1e28de682eb8f8 100644 (file)
@@ -44,6 +44,7 @@
 #include "macro.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "set.h"
index 78adcf18d6f23b648bb5b595e9348cd196b94b0a..51a2c6dfd7b7332f6d1088f030119ea4b9b83a9e 100644 (file)
@@ -28,6 +28,7 @@
 #include "hashmap.h"
 #include "log.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "string-util.h"
 #include "strv.h"
index f5fb6a09fe070e648f3c246e7be3d049b7d53a26..4c1d8a8e74655b39bbd1c093ee7e04299aafe087 100644 (file)
@@ -32,6 +32,7 @@
 #include "escape.h"
 #include "fileio.h"
 #include "log.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "string-util.h"
 #include "strv.h"
index 7f26108e9ccfeeb416a4fc1dbf79e7a2fc389a64..115f99e68caf14d841eaa6bcb5bb9690b5a3cc85 100644 (file)
@@ -24,6 +24,7 @@
 #include "unit-name.h"
 #include "mkdir.h"
 #include "string-util.h"
+#include "parse-util.h"
 
 static const char *arg_dest = "/tmp";
 static char **arg_mask = NULL;
index 5dbd526b9b3a3654bed723b5463153e7b5d6d799..bb2e6195b98f9c5ff3f6ab61eac72b438b388735 100644 (file)
@@ -30,6 +30,7 @@
 #include "hashmap.h"
 #include "log.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
index 5aa247b2ae0c80c320fb85c71e2f409905c7b8fe..abb5e77966aa69d47eb5463bd86054b1697fb28a 100644 (file)
 
 #include "ask-password-api.h"
 #include "copy.h"
+#include "fd-util.h"
 #include "fileio.h"
 #include "hostname-util.h"
 #include "locale-util.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "random-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "time-util.h"
-#include "string-util.h"
-#include "fd-util.h"
 
 static char *arg_root = NULL;
 static char *arg_locale = NULL;  /* $LANG */
index 9c49557787d22c8ef2cbfe3c0aabd80e74d604e0..7415be1529b7464b548d784d427ff24e21b38aaf 100644 (file)
@@ -37,6 +37,7 @@
 #include "bus-util.h"
 #include "device-util.h"
 #include "fd-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
index 0a3917b7ba3cc26360706c75585c7ff1dc6ac2ae..18baf6cc7d34392e46992cb8747524b32f1347ea 100644 (file)
@@ -31,6 +31,7 @@
 #include "log.h"
 #include "mkdir.h"
 #include "mount-setup.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "special.h"
 #include "string-util.h"
index ba97c98d6f22939e0d4a1156325e8c6b31dd5450..ac6d731753ef3ae6dfed6fe86deae2a579fc55d5 100644 (file)
@@ -37,6 +37,7 @@
 #include "gpt.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "special.h"
 #include "string-util.h"
index dd508aefb5f4a6893d3f9408f54d81dbe09f1407..8bff7d4b39f797317ed06f71fb77837321845a63 100644 (file)
 #include <unistd.h>
 #include <sys/utsname.h>
 
-#include "util.h"
-#include "strv.h"
+#include "bus-util.h"
 #include "def.h"
-#include "virt.h"
 #include "env-util.h"
-#include "fileio-label.h"
-#include "bus-util.h"
 #include "event-util.h"
-#include "selinux-util.h"
+#include "fileio-label.h"
 #include "hostname-util.h"
+#include "parse-util.h"
+#include "selinux-util.h"
+#include "strv.h"
+#include "util.h"
+#include "virt.h"
 
 #define VALID_DEPLOYMENT_CHARS (DIGITS LETTERS "-.:")
 
index b712cedcc6b3ce547a356a687b49216351e01caa..975907e3c922d9f3efca32af6eff840fad0860ce 100644 (file)
@@ -32,6 +32,7 @@
 #include "machine-pool.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
index 4736306de22c0ecf425096a8635f7b8f44a8be50..fd058777050da66b5fa538b0f7b10056d6e685ec 100644 (file)
@@ -24,6 +24,7 @@
 #include "fd-util.h"
 #include "io-util.h"
 #include "machine-pool.h"
+#include "parse-util.h"
 #include "pull-job.h"
 #include "string-util.h"
 #include "strv.h"
index 73d5f391c253e2abfeaf5401180c487825cfa812..502993307486f0e1e90594863d862f67979846fe 100644 (file)
@@ -27,6 +27,7 @@
 #include "hostname-util.h"
 #include "import-util.h"
 #include "machine-image.h"
+#include "parse-util.h"
 #include "pull-dkr.h"
 #include "pull-raw.h"
 #include "pull-tar.h"
index 92ef723affff703321ace3b3d7b16f48123b0536..b8a513bb749c665f228d71b351156aee1b7f0afd 100644 (file)
@@ -40,6 +40,7 @@
 #include "log.h"
 #include "logs-show.h"
 #include "microhttpd-util.h"
+#include "parse-util.h"
 #include "sigbus.h"
 #include "util.h"
 
index bb299e378c66dd85f81b0b133fd1b9d7eecb7395..db1636ac3e6ce1be9262ae4301d7e24ad063cdb4 100644 (file)
@@ -22,6 +22,7 @@
 #include "fd-util.h"
 #include "journal-remote-parse.h"
 #include "journald-native.h"
+#include "parse-util.h"
 #include "string-util.h"
 
 #define LINE_CHUNK 8*1024u
index de207f8d249e6f9d0dbf78312cd58ab3d5a1e9fe..01c8e5c37ac52a28fe5e25c02177a2d868d0c135 100644 (file)
@@ -44,6 +44,7 @@
 #include "journal-remote.h"
 #include "journald-native.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "signal-util.h"
 #include "socket-util.h"
 #include "string-util.h"
index a945a9971a637364136bc01df340322a970af9af..20e2a2f73bdde82037da4a59b5eeeb1f088e9cfb 100644 (file)
@@ -34,6 +34,7 @@
 #include "journal-upload.h"
 #include "log.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "sigbus.h"
 #include "signal-util.h"
 #include "string-util.h"
index ff1887604a59fed529610fdfe893ee62ff4ef6d9..95a1868b939a1746c6d39741d1e802e76bcb1eb4 100644 (file)
@@ -29,6 +29,7 @@
 #include "sd-journal.h"
 
 #include "fd-util.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
 
index 7336db219b982921232f648d4941d6ebefaa6897..92f598464a3b86c009fda84793d12d15cd9f7aae 100644 (file)
@@ -47,6 +47,7 @@
 #include "log.h"
 #include "macro.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "special.h"
 #include "stacktrace.h"
index f891ddffc6b92d55089f2aeedcf4b0346d042f47..fecccd4eb92b9b9c46feeb97c6c61701a3e7f910 100644 (file)
@@ -34,6 +34,7 @@
 #include "log.h"
 #include "macro.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "set.h"
@@ -41,8 +42,8 @@
 #include "signal-util.h"
 #include "string-util.h"
 #include "terminal-util.h"
-#include "util.h"
 #include "user-util.h"
+#include "util.h"
 
 static enum {
         ACTION_NONE,
index f193cb90ce607704fad9f77934e1869ac3c1e29e..c33e278cbe628ea51f8a33bd690fda6eee965c81 100644 (file)
@@ -35,6 +35,7 @@
 #include "journal-def.h"
 #include "journal-file.h"
 #include "lookup3.h"
+#include "parse-util.h"
 #include "random-util.h"
 #include "string-util.h"
 
index dca5bf5000d7abbc3dc727b6f373c33ec12dee0f..026dca49012590de441cb4de752582032110e8c0 100644 (file)
@@ -29,6 +29,7 @@
 #include "journal-def.h"
 #include "journal-file.h"
 #include "journal-vacuum.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
 
index 6e452a4d5113291cf9cb38309f8afd7b107176d5..c13b674e15dcf0009c094e81da3c061014277873 100644 (file)
@@ -56,6 +56,7 @@
 #include "logs-show.h"
 #include "mkdir.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
 #include "sigbus.h"
index 5f3eb052752785afbd26be869711382c8a18dc8d..4a5e07ec5dfa609406a8491c4b642991199c0c7b 100644 (file)
 #include <fcntl.h>
 #include <sys/socket.h>
 
+#include "fd-util.h"
 #include "fileio.h"
-#include "journald-server.h"
-#include "journald-console.h"
 #include "formats-util.h"
+#include "journald-console.h"
+#include "journald-server.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "terminal-util.h"
-#include "fd-util.h"
 
 static bool prefix_timestamp(void) {
 
index 5a05632e56e0b0210ccf217fc4e7ba2a0dc1bea8..e680aafafe051986e1a795ccb5d47c6f42394f33 100644 (file)
@@ -34,6 +34,7 @@
 #include "journald-kmsg.h"
 #include "journald-server.h"
 #include "journald-syslog.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "string-util.h"
 
index 7d4aac687e42d9763f32b8972420c13e80614039..ae229ecaf54af5aca029a98fa3a2a5da223f0bf8 100644 (file)
@@ -32,6 +32,7 @@
 #include "journald-syslog.h"
 #include "journald-wall.h"
 #include "memfd-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "selinux-util.h"
 #include "socket-util.h"
index 7cefea323e8e53b7540410008da04c96c53b8de6..f286e3030f77b7df1f8fc382ce338fbd7abb7f3a 100644 (file)
@@ -54,6 +54,7 @@
 #include "journald-syslog.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "rm-rf.h"
 #include "selinux-util.h"
index 0dd511519c5be1be633aed264af35e50f074c592..6745864da11a0080100ab5046d16dfd557422896 100644 (file)
@@ -39,6 +39,7 @@
 #include "journald-syslog.h"
 #include "journald-wall.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "selinux-util.h"
 #include "socket-util.h"
 #include "string-util.h"
index 0a9ab7f52ca0a979adbb8c5aaeba2ed9c0334151..5a2f0564ca49b9a656aaf73513158d7707e40559 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "compress.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "random-util.h"
 #include "string-util.h"
 #include "util.h"
index 717b703d19108c0f27c139885f606b986b6c757f..142da85041f6df4fe6e32cd880f015832fc26a43 100644 (file)
@@ -22,6 +22,7 @@
 #include "sd-journal.h"
 
 #include "log.h"
+#include "parse-util.h"
 #include "rm-rf.h"
 #include "util.h"
 
index 8069339c1f485c7956b8980ece9d58371940343e..3c8b0268a4ab268849b42531bbb312f2f0afe240 100644 (file)
 #include <fcntl.h>
 
 #include "sd-journal.h"
+
 #include "journal-file.h"
 #include "journal-vacuum.h"
-#include "util.h"
 #include "log.h"
+#include "parse-util.h"
 #include "rm-rf.h"
+#include "util.h"
 
 /* This program tests skipping around in a multi-file journal.
  */
index b5ecf2f375c8d614a8b80ce8fb87978123072c30..b8482743a2c5841796d84d645cbbe06d63475609 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 #include "sd-journal.h"
-#include "util.h"
+
+#include "journal-file.h"
+#include "journal-internal.h"
 #include "log.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "rm-rf.h"
-#include "journal-file.h"
-#include "journal-internal.h"
+#include "util.h"
 
 #define N_ENTRIES 200
 
index 39551b576166c3d7bd451f88081a9dfe66b3af1d..926ad0b02f334decc7154ca3c532e86b6dc364f7 100644 (file)
 #include "conf-parser.h"
 #include "dhcp-lease-internal.h"
 #include "log.h"
+#include "network-internal.h"
+#include "parse-util.h"
 #include "siphash24.h"
 #include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
 #include "util.h"
-#include "network-internal.h"
 
 const char *net_get_name(struct udev_device *device) {
         const char *name, *field;
index d982936a28f7d7fbabaafc9f9dc385021de53a99..94a276fb289cb96b9ddb62d0a2b078f4c5a75ac4 100644 (file)
@@ -34,6 +34,7 @@
 #include "hostname-util.h"
 #include "in-addr-util.h"
 #include "network-internal.h"
+#include "parse-util.h"
 #include "unaligned.h"
 
 int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) {
index 08421c3575162acc356cb567d23fc93e1e33fcc6..9485a7df64a4c0895dff157cee07d9ca86c8a0be 100644 (file)
@@ -32,6 +32,7 @@
 #include "event-util.h"
 #include "in-addr-util.h"
 #include "netlink-util.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
 
index d7bff784b8d3fb960943c21536d1647ab13b3b94..eee53b6407d43a1da61ed40b3c1df9e4b08e3e17 100644 (file)
@@ -32,6 +32,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "formats-util.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "strv.h"
index f311e86d4466e3c282c94826e2a084eeb0ab101f..6f396b795310c58d78ad8ce334727dd4cb515218 100644 (file)
@@ -45,6 +45,7 @@
 #include "fileio.h"
 #include "formats-util.h"
 #include "memfd-util.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
index d3e846db84b3ed2d919baed502d284258beaf34b..4b121e849ab3a2940e4a60b903b82535ca16ceb2 100644 (file)
@@ -33,6 +33,7 @@
 #include "fd-util.h"
 #include "log.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
 #include "strv.h"
index 7b91c2583dfb3da917bc55c683341f91705f8d30..36370e79e39da5fafc765ed161b168f3d7165823 100644 (file)
@@ -48,6 +48,7 @@
 #include "hostname-util.h"
 #include "macro.h"
 #include "missing.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
index 85c73722df466f1fa77af17911458ad7ee75b2c2..a125be7cb872f8da4a523bd1c748f6288296131c 100644 (file)
@@ -36,6 +36,7 @@
 #include "sd-daemon.h"
 
 #include "fd-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "socket-util.h"
 #include "strv.h"
index bcabf9468d4a0132b2891244742f77814ff37274..91690d83f68f93006fdf781bde47d82ec0ad553c 100644 (file)
@@ -32,6 +32,7 @@
 #include "hashmap.h"
 #include "macro.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "refcnt.h"
 #include "set.h"
index 593dda52f2ab38c8a7104edec805dd948d1403cb..0e7a26523d4a57ae1e0cd916d685db05ae830c00 100644 (file)
@@ -31,6 +31,7 @@
 #include "fileio.h"
 #include "hashmap.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
 #include "string-util.h"
index f564d43e06aa57ca9eb3fc2d60674602c75bc929..05cba9651a5a027bf29341cce07e9bcb0efacf68 100644 (file)
@@ -36,6 +36,7 @@
 #include "io-util.h"
 #include "login-util.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "socket-util.h"
 #include "string-util.h"
 #include "strv.h"
index ad1227264c4ec4a1a4bf68ea6ea00a924eaa2c72..6cc3321f429ba7442878caeaf3f354eb1f1b1d88 100644 (file)
@@ -33,6 +33,7 @@
 #include "strv.h"
 #include "util.h"
 #include "fd-util.h"
+#include "parse-util.h"
 
 _public_ int sd_network_get_operational_state(char **state) {
         _cleanup_free_ char *s = NULL;
index 1e513f3ff7596eabb415c993ac4e7c9961d73423..bd349e3f6400e0ef2180d09cde3946b53fc981e7 100644 (file)
@@ -41,6 +41,7 @@
 #include "device-util.h"
 #include "libudev-device-internal.h"
 #include "libudev-private.h"
+#include "parse-util.h"
 
 /**
  * SECTION:libudev-device
index 1cd186dec3d13d8003ee0fb8f0ec8ac9afc45ca5..92443c819098846242b4221719c1893628a787e9 100644 (file)
@@ -35,6 +35,7 @@
 #include "logs-show.h"
 #include "macro.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "signal-util.h"
 #include "spawn-polkit-agent.h"
index c4b74eb734f4dfcfdbc5bc16f8214e3257c257dd..460c2f0bd8d1546e686618dd85fc80e682562c28 100644 (file)
@@ -30,6 +30,7 @@
 #include "formats-util.h"
 #include "logind-inhibit.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "user-util.h"
 #include "util.h"
index dad552d5f25e37da15a3e525fc2c800080f1a459..2566894d0579aaf4abf0f1eb1c5f1b4885241939 100644 (file)
@@ -31,6 +31,7 @@
 #include "logind-acl.h"
 #include "logind-seat.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "terminal-util.h"
 #include "util.h"
index 714b1cb2997cd34bcf70f05b025e7c1b40d8b8d5..9651d3e24afe2d420d08d07aede00be429f86689 100644 (file)
@@ -41,6 +41,7 @@
 #include "io-util.h"
 #include "logind-session.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "terminal-util.h"
 #include "user-util.h"
index 80328068cdd9e9b55be660762d77491fe49f0e74..9f3af59b545095df27fc2b738928796b5976451f 100644 (file)
@@ -36,6 +36,7 @@
 #include "label.h"
 #include "logind-user.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "rm-rf.h"
 #include "smack-util.h"
index dbd055a79a09361b028d15d38ac4ea99be3be53f..464da88bccbff9162e0b468c99ae1b083de48a87 100644 (file)
@@ -41,6 +41,7 @@
 #include "hostname-util.h"
 #include "login-util.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "socket-util.h"
 #include "strv.h"
 #include "terminal-util.h"
index e41f8add9860f9d66b4cae2bacd630d0babdbf64..7aff55b761d9f1db2ebaf0fdacff10047b01f049 100644 (file)
@@ -35,6 +35,7 @@
 #include "machine-dbus.h"
 #include "machine.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "special.h"
 #include "terminal-util.h"
 #include "unit-name.h"
index 23cc74ab54261fecaa2d68b789f117a5d057c347..274952b8ce2f5dcdca1511cfe90db2959f0eace6 100644 (file)
@@ -48,6 +48,7 @@
 #include "macro.h"
 #include "mkdir.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "ptyfwd.h"
index acb6b7ce240d11d805cf8729db655b203cb08c0c..be679acca0e62eb0878b2d519bd65f0cf6f882ea 100644 (file)
@@ -36,6 +36,7 @@
 #include "local-addresses.h"
 #include "netlink-util.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "socket-util.h"
 #include "string-util.h"
 #include "strv.h"
index dcd7b482d38e765c152f29f8bb3c6fac88a5e121..1beb7ffae4808b9a55c258f84dd909082cf6b31f 100644 (file)
 #include "conf-parser.h"
 #include "firewall-util.h"
 #include "netlink-util.h"
+#include "networkd-address.h"
 #include "networkd.h"
+#include "parse-util.h"
 #include "set.h"
 #include "string-util.h"
 #include "utf8.h"
 #include "util.h"
-#include "networkd-address.h"
 
 int address_new(Address **ret) {
         _cleanup_address_free_ Address *address = NULL;
index 1a1524dfb4e317013077e086a7520d27fc3da94e..f40a01fd78e2e098483fd76443d24b3a0350fffd 100644 (file)
@@ -22,8 +22,9 @@
 #include "bus-util.h"
 #include "strv.h"
 
-#include "networkd.h"
 #include "networkd-link.h"
+#include "networkd.h"
+#include "parse-util.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_operational_state, link_operstate, LinkOperationalState);
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_administrative_state, link_state, LinkState);
index bbc46062581d8c62aa18866ae00378753ff65fac..2dd16be3817c211463b5cc5a1c738a5d28f89232 100644 (file)
 #include "conf-parser.h"
 #include "missing.h"
 #include "networkd-link.h"
+#include "networkd-netdev-tunnel.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
-#include "networkd-netdev-tunnel.h"
 
 #define DEFAULT_TNL_HOP_LIMIT   64
 #define IP6_FLOWINFO_FLOWLABEL  htonl(0x000FFFFF)
index 150fd052c25a523e16eb22d0b23d54e36d8368bf..6cef5fb7aa1d2e8a938fd2b43fd249c077683f60 100644 (file)
@@ -30,6 +30,7 @@
 #include "network-internal.h"
 #include "networkd-network.h"
 #include "networkd.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
 
index fcca6790936d194fd3febbb39716308c655a0019..7ae6ca26005a704e2123f6a5f3d70b08a6d01228 100644 (file)
 #include "conf-parser.h"
 #include "in-addr-util.h"
 #include "netlink-util.h"
+#include "networkd-route.h"
 #include "networkd.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
-#include "networkd-route.h"
 
 int route_new(Route **ret) {
         _cleanup_route_free_ Route *route = NULL;
index 4e4a4bbd5885a54e34d76994b50991b54674237c..3ada0ce32b2e62e1d2a3597dca0e30fb130445fc 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "conf-parser.h"
 #include "networkd-util.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
 
index 288e0a43166866a600f6031204d75a96105c329f..77f017dbac6624d2decd3c8bae128f21d335deef 100644 (file)
@@ -30,6 +30,7 @@
 #include "env-util.h"
 #include "formats-util.h"
 #include "log.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
index 98e4a7682f2eb842f39e08bbff55cb1da3046035..89c8240399209247871727d4e40f2e5e7aec2062 100644 (file)
@@ -27,6 +27,7 @@
 #include "local-addresses.h"
 #include "netlink-util.h"
 #include "nspawn-expose-ports.h"
+#include "parse-util.h"
 #include "socket-util.h"
 #include "string-util.h"
 #include "util.h"
index 25457fd62d6ceec9e30fb0f6e54ca521e92984f9..5d8172092a651afee094f547647af7998839fd01 100644 (file)
 #include "escape.h"
 #include "label.h"
 #include "mkdir.h"
+#include "nspawn-mount.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "rm-rf.h"
 #include "set.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
-#include "nspawn-mount.h"
 
 CustomMount* custom_mount_add(CustomMount **l, unsigned *n, CustomMountType t) {
         CustomMount *c, *ret;
index 6502fe1943bc5a1d94b5b0795e887f3a028d3612..a4eefe5eb88c071d53981734bfcbd4351f09e763 100644 (file)
@@ -77,6 +77,7 @@
 #include "nspawn-register.h"
 #include "nspawn-settings.h"
 #include "nspawn-setuid.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "ptyfwd.h"
index 97516a87a8c8d859d5de3a3f177da36738864118..9b808ff110fa17a413b1679c9ae0e281e778d1fb 100644 (file)
@@ -28,6 +28,7 @@
 #include "bus-error.h"
 #include "bus-util.h"
 #include "in-addr-util.h"
+#include "parse-util.h"
 #include "resolved-def.h"
 #include "resolved-dns-packet.h"
 
index 22a5c7fdbfb58b944f0958e5871f8994fbbc832f..17eafec2fa65d7d7895e2af09e3bdacfdb903559 100644 (file)
  ***/
 
 #include "conf-parser.h"
-#include "string-util.h"
+#include "parse-util.h"
 #include "resolved-conf.h"
 #include "extract-word.h"
+#include "string-util.h"
 
 int manager_parse_dns_server(Manager *m, DnsServerType type, const char *string) {
         DnsServer *first;
index 43a3b61b08a8ee5ffd6b9d4dd5d0dd239bc83b5d..8c88e2dbf11a2f44a94304b9200c4227b97073f6 100644 (file)
@@ -24,6 +24,7 @@
 #include "sd-network.h"
 
 #include "missing.h"
+#include "parse-util.h"
 #include "resolved-link.h"
 #include "string-util.h"
 #include "strv.h"
index 6144eedfeb87242e2ed979290ca42a9419f0beb2..a6aac196dbf41a11ebc6268b9cfb7b30e97486b2 100644 (file)
@@ -33,6 +33,7 @@
 #include "netlink-util.h"
 #include "network-internal.h"
 #include "ordered-set.h"
+#include "parse-util.h"
 #include "random-util.h"
 #include "resolved-bus.h"
 #include "resolved-conf.h"
index 311343e4547eec44aa4ec0b8291d288e48a92118..559a17653531c84aa6df86408f55b1cb6ceeea51 100644 (file)
@@ -30,6 +30,7 @@
 #include "fileio.h"
 #include "io-util.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "udev-util.h"
 #include "util.h"
index 3646305961907e54d68fed3fcd271f9ad6cfd0f2..dbcb29546f5a434ecf66d58b754bb8e0f0b3ef02 100644 (file)
@@ -40,6 +40,7 @@
 #include "terminal-util.h"
 #include "unit-name.h"
 #include "user-util.h"
+#include "parse-util.h"
 
 static bool arg_ask_password = true;
 static bool arg_scope = false;
index c2bbd330bdd212051bbe5418d1f0ec7987b80a01..48d0f84995fabebd10acc7a8a7d9697672c1ed58 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
-#include "util.h"
-#include "fileio.h"
 #include "apparmor-util.h"
+#include "fileio.h"
+#include "parse-util.h"
+#include "util.h"
 
 bool mac_apparmor_use(void) {
         static int cached_use = -1;
index 604b8f248a2b3f089806ddc403fe4d3ec83ac61b..53b9752af0a749b96d25b250e06bbf97cfcf0ee1 100644 (file)
@@ -37,6 +37,7 @@
 #include "fd-util.h"
 #include "macro.h"
 #include "missing.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
 #include "signal-util.h"
index b8915dab8a59d25435fcd109e41afc3dae0ccaeb..145ea410956d35fedfe5a6ae138237d2bbe860c5 100644 (file)
@@ -36,6 +36,7 @@
 #include "fd-util.h"
 #include "hostname-util.h"
 #include "ima-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "selinux-util.h"
 #include "smack-util.h"
index 1b47c0ab527af0cfd2c1cc6bd7c83f0882d00750..8bb33add720ec2cf942edabc4d746692ccc6b87f 100644 (file)
 #include "sd-messages.h"
 
 #include "conf-files.h"
+#include "conf-parser.h"
+#include "fd-util.h"
 #include "log.h"
 #include "macro.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "signal-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
 #include "util.h"
-#include "conf-parser.h"
-#include "fd-util.h"
 
 int config_item_table_lookup(
                 const void *table,
index d4df9d2acbaeff724530d6906e7d8451b354803d..a8176af8404726a873fbaaca36ef5190f11fae19 100644 (file)
@@ -24,8 +24,9 @@
 #include <stringprep.h>
 #endif
 
-#include "string-util.h"
 #include "dns-domain.h"
+#include "parse-util.h"
+#include "string-util.h"
 
 int dns_label_unescape(const char **name, char *dest, size_t sz) {
         const char *n;
index 4808ede60c701734fea4832372d506fe50a25f95..771bc9458c65e7b5c64114049bae84bd599336af 100644 (file)
@@ -26,6 +26,7 @@
 #include "efivars.h"
 #include "fd-util.h"
 #include "io-util.h"
+#include "parse-util.h"
 #include "utf8.h"
 #include "util.h"
 #include "virt.h"
index bdfc13e3cd08bd4c4dd8cda446595d9b5760318d..20fb0f5a065256ba2c2b9ec391da52491f26ab58 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include "fstab-util.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
-#include "fstab-util.h"
 
 bool fstab_is_mount_point(const char *mount) {
         _cleanup_endmntent_ FILE *f = NULL;
index d8ea4c9f9269a94b71e5560138df818c23183c8b..3519323b7ae4b184f9bf52dcada9016c8dd87ce5 100644 (file)
@@ -33,6 +33,7 @@
 #include "journal-internal.h"
 #include "log.h"
 #include "logs-show.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "terminal-util.h"
index a2cb5fc5a011a127e9694715fb47c17d7766fb87..c576242b59917662b81886dc96ce8d074d5ba05a 100644 (file)
@@ -29,6 +29,7 @@
 #include "lockfile-util.h"
 #include "machine-pool.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
index b5cb9508bf5fb02f705f494039ad9fc38806190c..0e232e6aa6f20960fa0d3ac297d7c5ea7cbd22ed 100644 (file)
@@ -29,6 +29,7 @@
 #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)
 
index fe4213c08558ca69968614c7dc6072763be1ac16..49a4b46fd429341d7f38a2f1d2258d95d3f55a05 100644 (file)
@@ -61,6 +61,7 @@
 #include "macro.h"
 #include "mkdir.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "path-lookup.h"
 #include "path-util.h"
 #include "process-util.h"
index afe3ff8fc2c82ba29a684d56d6ea0ff6a35d4900..33356f8387ad4bcc8968f12f8db8e87713e0a2d1 100644 (file)
@@ -25,6 +25,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "log.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "util.h"
 
index 43a2d35b80346c8d65f8bf598711a97ec1fa5a12..5f178684588fd1a9fabec54f1eca2c1875b3236b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "util.h"
-#include "fileio.h"
+#include <sys/prctl.h>
+
 #include "cap-list.h"
 #include "capability.h"
-#include <sys/prctl.h>
+#include "fileio.h"
+#include "parse-util.h"
+#include "util.h"
 
 /* verify the capability parser */
 static void test_cap_list(void) {
index 7bf59a0aa21e723816e171735e9bf969712e37e8..af8d478fa9e1e3385c4c3c2cf1b0042e9430ce51 100644 (file)
@@ -22,6 +22,7 @@
 #include "cgroup-util.h"
 #include "fd-util.h"
 #include "formats-util.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "test-helper.h"
index a40f013491bdd93624409425e20e38e1eaa0d07b..1c1fed4660b9a6e7f649df47dabf30c91259c1e2 100644 (file)
@@ -28,6 +28,7 @@
 #include "env-util.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "strv.h"
index c1f8a866affd010e83d0bd87424014de4945c15b..f42d8f19bb000fe5c8738262aa972689e320120e 100644 (file)
 #include "fileio.h"
 #include "io-util.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "rm-rf.h"
 #include "signal-util.h"
 #include "string-util.h"
 #include "strv.h"
+#include "user-util.h"
 #include "util.h"
 #include "virt.h"
-#include "user-util.h"
 
 static void test_streq_ptr(void) {
         assert_se(streq_ptr(NULL, NULL));
index 68fbe3f5b85a8323509d61b52960edfd83778581..564d72773a2e725d5429d2cd649a73e533e438d9 100644 (file)
@@ -30,6 +30,7 @@
 #include "bus-error.h"
 #include "bus-util.h"
 #include "pager.h"
+#include "parse-util.h"
 #include "spawn-polkit-agent.h"
 #include "strv.h"
 #include "terminal-util.h"
index 05c4661a2c5488725daee58425e0566d2168c204..57cca17e80730a2908ecbb835ff483189c3cc9d4 100644 (file)
@@ -52,6 +52,7 @@
 #include "macro.h"
 #include "missing.h"
 #include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "rm-rf.h"
 #include "selinux-util.h"
index e9577930e326636e0fc5d01f837144aa56aa2d08..7459ee1fe274ed408d219cbbc6e9ab47df6a9680 100644 (file)
@@ -34,6 +34,7 @@
 #include "missing.h"
 #include "netlink-util.h"
 #include "network-internal.h"
+#include "parse-util.h"
 #include "path-util.h"
 #include "random-util.h"
 #include "string-util.h"
index 5e97bdd614aa2a0d14b566fe98e84bb6d4438eab..74df4cb0f436834ac29f7fe37a7cb2594236ae25 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/input.h>
 
 #include "fd-util.h"
+#include "parse-util.h"
 #include "string-util.h"
 #include "udev.h"
 
index 3d6ca7a98589342c36fc3e9a7e5d37b8e6c14df0..c25071b0fee7b718747ab43f7636671af10bece5 100644 (file)
@@ -26,6 +26,7 @@
 #include <getopt.h>
 #include <poll.h>
 
+#include "parse-util.h"
 #include "udev.h"
 #include "util.h"
 
index df5fd88bff5808e1658e21ad2d3eb98932e87583..f1fc1cd0821eb67919e338add444510092f1b92f 100644 (file)
@@ -53,6 +53,7 @@
 #include "hashmap.h"
 #include "io-util.h"
 #include "netlink-util.h"
+#include "parse-util.h"
 #include "process-util.h"
 #include "selinux-util.h"
 #include "signal-util.h"