util-lib: move string table stuff into its own string-table.[ch]
This commit is contained in:
parent
8fcde01280
commit
8b43440b7e
|
@ -823,6 +823,8 @@ libbasic_la_SOURCES = \
|
|||
src/basic/locale-util.h \
|
||||
src/basic/signal-util.c \
|
||||
src/basic/signal-util.h \
|
||||
src/basic/string-table.c \
|
||||
src/basic/string-table.h \
|
||||
src/basic/mempool.c \
|
||||
src/basic/mempool.h \
|
||||
src/basic/hashmap.c \
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "process-util.h"
|
||||
#include "set.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "user-util.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "locale-util.h"
|
||||
#include "path-util.h"
|
||||
#include "set.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "utf8.h"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "process-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "missing.h"
|
||||
#include "rlimit-util.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
int setrlimit_closest(int resource, const struct rlimit *rlim) {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "parse-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "smack-util.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
#include "xattr-util.h"
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/*-*- 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 "string-table.h"
|
||||
|
||||
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
|
||||
size_t i;
|
||||
|
||||
if (!key)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
if (streq_ptr(table[i], key))
|
||||
return (ssize_t) i;
|
||||
|
||||
return -1;
|
||||
}
|
|
@ -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 <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "macro.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key);
|
||||
|
||||
/* For basic lookup tables with strictly enumerated entries */
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
scope const char *name##_to_string(type i) { \
|
||||
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
|
||||
return NULL; \
|
||||
return name##_table[i]; \
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
return (type) string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
||||
|
||||
#define DEFINE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,static)
|
||||
|
||||
/* For string conversions where numbers are also acceptable */
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name,type,max) \
|
||||
int name##_to_string_alloc(type i, char **str) { \
|
||||
char *s; \
|
||||
if (i < 0 || i > max) \
|
||||
return -ERANGE; \
|
||||
if (i < (type) ELEMENTSOF(name##_table)) { \
|
||||
s = strdup(name##_table[i]); \
|
||||
if (!s) \
|
||||
return -ENOMEM; \
|
||||
} else { \
|
||||
if (asprintf(&s, "%i", i) < 0) \
|
||||
return -ENOMEM; \
|
||||
} \
|
||||
*str = s; \
|
||||
return 0; \
|
||||
} \
|
||||
type name##_from_string(const char *s) { \
|
||||
type i; \
|
||||
unsigned u = 0; \
|
||||
if (!s) \
|
||||
return (type) -1; \
|
||||
for (i = 0; i < (type) ELEMENTSOF(name##_table); i++) \
|
||||
if (streq_ptr(name##_table[i], s)) \
|
||||
return i; \
|
||||
if (safe_atou(s, &u) >= 0 && u <= max) \
|
||||
return (type) u; \
|
||||
return (type) -1; \
|
||||
} \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
|
@ -24,12 +24,13 @@
|
|||
|
||||
#include "bus-label.h"
|
||||
#include "def.h"
|
||||
#include "hexdecoct.h"
|
||||
#include "path-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
#include "unit-name.h"
|
||||
#include "hexdecoct.h"
|
||||
#include "util.h"
|
||||
|
||||
#define VALID_CHARS \
|
||||
DIGITS LETTERS \
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
#include "random-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "sparse-endian.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
|
@ -1450,19 +1451,6 @@ int syslog_parse_priority(const char **p, int *priority, bool with_facility) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
|
||||
size_t i;
|
||||
|
||||
if (!key)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
if (streq_ptr(table[i], key))
|
||||
return (ssize_t) i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int version(void) {
|
||||
puts(PACKAGE_STRING "\n"
|
||||
SYSTEMD_FEATURES);
|
||||
|
|
|
@ -83,62 +83,6 @@ static inline const char* one_zero(bool b) {
|
|||
return b ? "1" : "0";
|
||||
}
|
||||
|
||||
/* For basic lookup tables with strictly enumerated entries */
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
scope const char *name##_to_string(type i) { \
|
||||
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
|
||||
return NULL; \
|
||||
return name##_table[i]; \
|
||||
}
|
||||
|
||||
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key);
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
return (type) string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,scope) \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
||||
|
||||
#define DEFINE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type,static)
|
||||
|
||||
/* For string conversions where numbers are also acceptable */
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name,type,max) \
|
||||
int name##_to_string_alloc(type i, char **str) { \
|
||||
char *s; \
|
||||
if (i < 0 || i > max) \
|
||||
return -ERANGE; \
|
||||
if (i < (type) ELEMENTSOF(name##_table)) { \
|
||||
s = strdup(name##_table[i]); \
|
||||
if (!s) \
|
||||
return -ENOMEM; \
|
||||
} else { \
|
||||
if (asprintf(&s, "%i", i) < 0) \
|
||||
return -ENOMEM; \
|
||||
} \
|
||||
*str = s; \
|
||||
return 0; \
|
||||
} \
|
||||
type name##_from_string(const char *s) { \
|
||||
type i; \
|
||||
unsigned u = 0; \
|
||||
if (!s) \
|
||||
return (type) -1; \
|
||||
for (i = 0; i < (type) ELEMENTSOF(name##_table); i++) \
|
||||
if (streq_ptr(name##_table[i], s)) \
|
||||
return i; \
|
||||
if (safe_atou(s, &u) >= 0 && u <= max) \
|
||||
return (type) u; \
|
||||
return (type) -1; \
|
||||
} \
|
||||
struct __useless_struct_to_allow_trailing_semicolon__
|
||||
|
||||
bool fstype_is_network(const char *fstype);
|
||||
|
||||
#define xsprintf(buf, fmt, ...) \
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "fileio.h"
|
||||
#include "process-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "fileio.h"
|
||||
#include "formats-util.h"
|
||||
#include "set.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "unit.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "bus-kernel.h"
|
||||
#include "bus-policy.h"
|
||||
#include "kdbus.h"
|
||||
#include "string-table.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "service.h"
|
||||
#include "signal-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = {
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
#define CGROUP_CPU_QUOTA_PERIOD_USEC ((usec_t) 100 * USEC_PER_MSEC)
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
#include "selinux-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "smack-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
|
|
|
@ -23,10 +23,11 @@
|
|||
#include <sys/reboot.h>
|
||||
#include <linux/reboot.h>
|
||||
|
||||
#include "bus-util.h"
|
||||
#include "bus-error.h"
|
||||
#include "special.h"
|
||||
#include "bus-util.h"
|
||||
#include "failure-action.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "terminal-util.h"
|
||||
|
||||
static void log_and_status(Manager *m, const char *message) {
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "parse-util.h"
|
||||
#include "set.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#include "util.h"
|
||||
#include "signal-util.h"
|
||||
#include "kill.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
void kill_context_init(KillContext *c) {
|
||||
assert(c);
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
#include "signal-util.h"
|
||||
#include "special.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "smack-util.h"
|
||||
#include "special.h"
|
||||
#include "string-util.h"
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
#include "unit.h"
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "path-util.h"
|
||||
#include "selinux-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "path.h"
|
||||
#include "special.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "unit.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "load-dropin.h"
|
||||
#include "log.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "service.h"
|
||||
#include "signal-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#include "fd-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "show-status.h"
|
||||
#include "string-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int parse_show_status(const char *v, ShowStatus *ret) {
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "smack-util.h"
|
||||
#include "socket.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "swap.h"
|
||||
#include "udev-util.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "fs-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "timer.h"
|
||||
#include "unit-name.h"
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#include "util.h"
|
||||
#include "import-compress.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
void import_compress_free(ImportCompress *c) {
|
||||
assert(c);
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "process-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "journal-def.h"
|
||||
#include "macro.h"
|
||||
#include "sparse-endian.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "process-util.h"
|
||||
#include "special.h"
|
||||
#include "stacktrace.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include "selinux-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
#define USER_JOURNALS_MAX 1024
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "fd-util.h"
|
||||
#include "network-internal.h"
|
||||
#include "random-util.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
#define MAX_MAC_ADDR_LEN INFINIBAND_ALEN
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "path-util.h"
|
||||
#include "refcnt.h"
|
||||
#include "set.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "strxcpyx.h"
|
||||
|
|
|
@ -28,16 +28,15 @@
|
|||
#include <linux/if_bridge.h>
|
||||
#include <linux/if_addr.h>
|
||||
#include <linux/if.h>
|
||||
|
||||
#include <linux/ip.h>
|
||||
#include <linux/if_link.h>
|
||||
#include <linux/if_tunnel.h>
|
||||
|
||||
#include "macro.h"
|
||||
#include "util.h"
|
||||
|
||||
#include "netlink-types.h"
|
||||
#include "missing.h"
|
||||
#include "netlink-types.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
/* Maximum ARP IP target defined in kernel */
|
||||
#define BOND_MAX_ARP_TARGETS 16
|
||||
|
|
|
@ -21,14 +21,15 @@
|
|||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "special.h"
|
||||
#include "sleep-config.h"
|
||||
#include "bus-util.h"
|
||||
#include "bus-error.h"
|
||||
#include "logind-action.h"
|
||||
#include "bus-util.h"
|
||||
#include "conf-parser.h"
|
||||
#include "formats-util.h"
|
||||
#include "logind-action.h"
|
||||
#include "process-util.h"
|
||||
#include "sleep-config.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "terminal-util.h"
|
||||
#include "user-util.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "logind-inhibit.h"
|
||||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "string-table.h"
|
||||
#include "terminal-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "rm-rf.h"
|
||||
#include "smack-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "special.h"
|
||||
#include "string-table.h"
|
||||
#include "terminal-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "parse-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-util.h"
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "networkd-netdev.h"
|
||||
#include "set.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "udev-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
|
||||
#include "conf-parser.h"
|
||||
#include "missing.h"
|
||||
#include "string-util.h"
|
||||
#include "networkd-netdev-bond.h"
|
||||
#include "string-util.h"
|
||||
#include "string-table.h"
|
||||
|
||||
/*
|
||||
* Number of seconds between instances where the bonding
|
||||
|
|
|
@ -21,8 +21,9 @@
|
|||
|
||||
#include <net/if.h>
|
||||
|
||||
#include "networkd-netdev-ipvlan.h"
|
||||
#include "conf-parser.h"
|
||||
#include "networkd-netdev-ipvlan.h"
|
||||
#include "string-table.h"
|
||||
|
||||
static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = {
|
||||
[NETDEV_IPVLAN_MODE_L2] = "L2",
|
||||
|
|
|
@ -21,8 +21,9 @@
|
|||
|
||||
#include <net/if.h>
|
||||
|
||||
#include "networkd-netdev-macvlan.h"
|
||||
#include "conf-parser.h"
|
||||
#include "networkd-netdev-macvlan.h"
|
||||
#include "string-table.h"
|
||||
|
||||
static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {
|
||||
[NETDEV_MACVLAN_MODE_PRIVATE] = "private",
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "networkd-link.h"
|
||||
#include "networkd-netdev-tunnel.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "networkd.h"
|
||||
#include "siphash24.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "networkd.h"
|
||||
#include "parse-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "conf-parser.h"
|
||||
#include "networkd-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -19,12 +19,13 @@
|
|||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "strv.h"
|
||||
#include "unaligned.h"
|
||||
#include "dns-domain.h"
|
||||
#include "resolved-dns-packet.h"
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
#include "unaligned.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
|
||||
int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t mtu) {
|
||||
DnsPacket *p;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "random-util.h"
|
||||
#include "resolved-dns-transaction.h"
|
||||
#include "resolved-llmnr.h"
|
||||
#include "string-table.h"
|
||||
|
||||
DnsTransaction* dns_transaction_free(DnsTransaction *t) {
|
||||
DnsQuery *q;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "resolved-llmnr.h"
|
||||
#include "resolved-manager.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "utf8.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "io-util.h"
|
||||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "udev-util.h"
|
||||
#include "util.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "architecture.h"
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "selinux-util.h"
|
||||
#include "smack-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "btrfs-util.h"
|
||||
#include "import-util.h"
|
||||
#include "path-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "set.h"
|
||||
#include "special.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "logs-show.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "utf8.h"
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "mkdir.h"
|
||||
#include "path-util.h"
|
||||
#include "rm-rf.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "utf8.h"
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include "set.h"
|
||||
#include "specifier.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
|
|
|
@ -19,17 +19,17 @@
|
|||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/sockios.h>
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "ethtool-util.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "string-table.h"
|
||||
#include "strxcpyx.h"
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
#include "conf-parser.h"
|
||||
|
||||
static const char* const duplex_table[_DUP_MAX] = {
|
||||
[DUP_FULL] = "full",
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "path-util.h"
|
||||
#include "random-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
|
|
Loading…
Reference in New Issue