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 \
#include "hashmap.h"
#include "log.h"
#include "pager.h"
+#include "parse-util.h"
#include "special.h"
#include "strv.h"
#include "strxcpyx.h"
#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;
#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"
#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);
#include "fileio.h"
#include "log.h"
#include "macro.h"
+#include "parse-util.h"
#include "util.h"
int have_effective_cap(int value) {
#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"
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;
***/
#include "fd-util.h"
+#include "parse-util.h"
#include "util.h"
int close_nointr(int fd) {
#include "fd-util.h"
#include "fdset.h"
#include "macro.h"
+#include "parse-util.h"
#include "set.h"
#include "util.h"
#include "string-util.h"
#include "terminal-util.h"
#include "util.h"
+#include "parse-util.h"
#define SNDBUF_SIZE (8*1024*1024)
--- /dev/null
+/*-*- 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;
+}
--- /dev/null
+/*-*- 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);
#include "log.h"
#include "macro.h"
#include "missing.h"
+#include "parse-util.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
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,
return signo;
}
+
+void nop_signal_handler(int sig) {
+ /* nothing here */
+}
int signal_from_string(const char *s) _pure_;
int signal_from_string_try_harder(const char *s);
+
+void nop_signal_handler(int sig);
#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"
#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"
#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) {
#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"
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;
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
}
}
-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;
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);
}
}
-void nop_signal_handler(int sig) {
- /* nothing here */
-}
-
int version(void) {
puts(PACKAGE_STRING "\n"
SYSTEMD_FEATURES);
#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())
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);
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, ...);
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);
#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"
#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"
#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"
#include "label.h"
#include "mkdir.h"
#include "mount.h"
+#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "special.h"
#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"
#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"
#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);
#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,
#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"
#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"
#include "terminal-util.h"
#include "unit.h"
#include "virt.h"
-#include "job.h"
Job* job_new_raw(Unit *unit) {
Job *j;
#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"
#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"
#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"
#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"
#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"
#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"
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;
#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"
#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,
typedef struct Snapshot Snapshot;
+#include "unit.h"
+
struct Snapshot {
Unit meta;
#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"
#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"
#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"
#include "macro.h"
#include "missing.h"
#include "mkdir.h"
+#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "set.h"
#include "hashmap.h"
#include "log.h"
#include "mkdir.h"
+#include "parse-util.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
#include "escape.h"
#include "fileio.h"
#include "log.h"
+#include "parse-util.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
#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;
#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"
#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 */
#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"
#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"
#include "gpt.h"
#include "missing.h"
#include "mkdir.h"
+#include "parse-util.h"
#include "path-util.h"
#include "special.h"
#include "string-util.h"
#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 "-.:")
#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"
#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"
#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"
#include "log.h"
#include "logs-show.h"
#include "microhttpd-util.h"
+#include "parse-util.h"
#include "sigbus.h"
#include "util.h"
#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
#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"
#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"
#include "sd-journal.h"
#include "fd-util.h"
+#include "parse-util.h"
#include "string-util.h"
#include "util.h"
#include "log.h"
#include "macro.h"
#include "mkdir.h"
+#include "parse-util.h"
#include "process-util.h"
#include "special.h"
#include "stacktrace.h"
#include "log.h"
#include "macro.h"
#include "pager.h"
+#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "set.h"
#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,
#include "journal-def.h"
#include "journal-file.h"
#include "lookup3.h"
+#include "parse-util.h"
#include "random-util.h"
#include "string-util.h"
#include "journal-def.h"
#include "journal-file.h"
#include "journal-vacuum.h"
+#include "parse-util.h"
#include "string-util.h"
#include "util.h"
#include "logs-show.h"
#include "mkdir.h"
#include "pager.h"
+#include "parse-util.h"
#include "path-util.h"
#include "set.h"
#include "sigbus.h"
#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) {
#include "journald-kmsg.h"
#include "journald-server.h"
#include "journald-syslog.h"
+#include "parse-util.h"
#include "process-util.h"
#include "string-util.h"
#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"
#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"
#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"
#include "compress.h"
#include "macro.h"
+#include "parse-util.h"
#include "random-util.h"
#include "string-util.h"
#include "util.h"
#include "sd-journal.h"
#include "log.h"
+#include "parse-util.h"
#include "rm-rf.h"
#include "util.h"
#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.
*/
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
#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;
#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) {
#include "event-util.h"
#include "in-addr-util.h"
#include "netlink-util.h"
+#include "parse-util.h"
#include "string-util.h"
#include "util.h"
#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"
#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"
#include "fd-util.h"
#include "log.h"
#include "pager.h"
+#include "parse-util.h"
#include "path-util.h"
#include "set.h"
#include "strv.h"
#include "hostname-util.h"
#include "macro.h"
#include "missing.h"
+#include "parse-util.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
#include "sd-daemon.h"
#include "fd-util.h"
+#include "parse-util.h"
#include "path-util.h"
#include "socket-util.h"
#include "strv.h"
#include "hashmap.h"
#include "macro.h"
#include "mkdir.h"
+#include "parse-util.h"
#include "path-util.h"
#include "refcnt.h"
#include "set.h"
#include "fileio.h"
#include "hashmap.h"
#include "macro.h"
+#include "parse-util.h"
#include "path-util.h"
#include "set.h"
#include "string-util.h"
#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"
#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;
#include "device-util.h"
#include "libudev-device-internal.h"
#include "libudev-private.h"
+#include "parse-util.h"
/**
* SECTION:libudev-device
#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"
#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"
#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"
#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"
#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"
#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"
#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"
#include "macro.h"
#include "mkdir.h"
#include "pager.h"
+#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "ptyfwd.h"
#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"
#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;
#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);
#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)
#include "network-internal.h"
#include "networkd-network.h"
#include "networkd.h"
+#include "parse-util.h"
#include "string-util.h"
#include "util.h"
#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;
#include "conf-parser.h"
#include "networkd-util.h"
+#include "parse-util.h"
#include "string-util.h"
#include "util.h"
#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"
#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"
#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;
#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"
#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"
***/
#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;
#include "sd-network.h"
#include "missing.h"
+#include "parse-util.h"
#include "resolved-link.h"
#include "string-util.h"
#include "strv.h"
#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"
#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"
#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;
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;
#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"
#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"
#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,
#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;
#include "efivars.h"
#include "fd-util.h"
#include "io-util.h"
+#include "parse-util.h"
#include "utf8.h"
#include "util.h"
#include "virt.h"
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;
#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"
#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"
#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)
#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"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
+#include "parse-util.h"
#include "string-util.h"
#include "util.h"
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) {
#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"
#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"
#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));
#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"
#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"
#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"
#include <linux/input.h>
#include "fd-util.h"
+#include "parse-util.h"
#include "string-util.h"
#include "udev.h"
#include <getopt.h>
#include <poll.h>
+#include "parse-util.h"
#include "udev.h"
#include "util.h"
#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"