string-table: Move more implementation logic into functions
Let's move some more implementation logic into functions. We keep the logic that requires the macro in the macro and move the rest into functions. While we're at it, let's also make the parameter declarations of all the string table macros less clausthrophobic.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "utf8.h"
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "format-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "rlimit-util.h"
|
||||
#include "string-table.h"
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "parse-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
|
||||
const char* string_table_lookup_to_string(const char * const *table, size_t len, ssize_t i) {
|
||||
if (i < 0 || i >= (ssize_t) len)
|
||||
return NULL;
|
||||
|
||||
return table[i];
|
||||
}
|
||||
|
||||
ssize_t string_table_lookup_from_string(const char * const *table, size_t len, const char *key) {
|
||||
if (!key)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -13,3 +21,49 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ssize_t string_table_lookup_from_string_with_boolean(const char * const *table, size_t len, const char *key, ssize_t yes) {
|
||||
if (!key)
|
||||
return -EINVAL;
|
||||
|
||||
int b = parse_boolean(key);
|
||||
if (b == 0)
|
||||
return 0;
|
||||
if (b > 0)
|
||||
return yes;
|
||||
|
||||
return string_table_lookup_from_string(table, len, key);
|
||||
}
|
||||
|
||||
int string_table_lookup_to_string_fallback(const char * const *table, size_t len, ssize_t i, size_t max, char **ret) {
|
||||
char *s;
|
||||
|
||||
if (i < 0 || i > (ssize_t) max)
|
||||
return -ERANGE;
|
||||
if (i < (ssize_t) len && table[i]) {
|
||||
s = strdup(table[i]);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
} else if (asprintf(&s, "%zd", i) < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
*ret = s;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t string_table_lookup_from_string_fallback(const char * const *table, size_t len, const char *s, size_t max) {
|
||||
unsigned u = 0;
|
||||
|
||||
if (!s)
|
||||
return -EINVAL;
|
||||
|
||||
ssize_t i = string_table_lookup_from_string(table, len, s);
|
||||
if (i >= 0)
|
||||
return i;
|
||||
if (safe_atou(s, &u) < 0)
|
||||
return -EINVAL;
|
||||
if (u > max)
|
||||
return -EINVAL;
|
||||
|
||||
return u;
|
||||
}
|
||||
|
||||
+49
-74
@@ -2,105 +2,80 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.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);
|
||||
const char* string_table_lookup_to_string(const char * const *table, size_t len, ssize_t i);
|
||||
|
||||
ssize_t string_table_lookup_from_string(const char * const *table, size_t len, const char *key);
|
||||
|
||||
ssize_t string_table_lookup_from_string_with_boolean(const char * const *table, size_t len, const char *key, ssize_t yes);
|
||||
|
||||
int string_table_lookup_to_string_fallback(const char * const *table, size_t len, ssize_t i, size_t max, char **ret);
|
||||
|
||||
ssize_t string_table_lookup_from_string_fallback(const char * const *table, size_t len, const char *s, size_t max);
|
||||
|
||||
/* 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_TO_STRING(name, type, scope) \
|
||||
scope const char* name##_to_string(type i) { \
|
||||
return string_table_lookup_to_string(name##_table, ELEMENTSOF(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_FROM_STRING(name, type, scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
return (type) string_table_lookup_from_string(name##_table, ELEMENTSOF(name##_table), s); \
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
if (!s) \
|
||||
return -EINVAL; \
|
||||
int b = parse_boolean(s); \
|
||||
if (b == 0) \
|
||||
return (type) 0; \
|
||||
if (b > 0) \
|
||||
return yes; \
|
||||
return (type) string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name, type, yes, scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
return (type) string_table_lookup_from_string_with_boolean(name##_table, ELEMENTSOF(name##_table), s, yes); \
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max,scope) \
|
||||
scope int name##_to_string_alloc(type i, char **str) { \
|
||||
char *s; \
|
||||
if (i < 0 || i > max) \
|
||||
return -ERANGE; \
|
||||
if (i < (type) ELEMENTSOF(name##_table) && name##_table[i]) { \
|
||||
s = strdup(name##_table[i]); \
|
||||
if (!s) \
|
||||
return -ENOMEM; \
|
||||
} else if (asprintf(&s, "%i", i) < 0) \
|
||||
return -ENOMEM; \
|
||||
*str = s; \
|
||||
return 0; \
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, scope) \
|
||||
scope int name##_to_string_alloc(type i, char **ret) { \
|
||||
return string_table_lookup_to_string_fallback(name##_table, ELEMENTSOF(name##_table), i, max, ret); \
|
||||
}
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
unsigned u = 0; \
|
||||
type i; \
|
||||
if (!s) \
|
||||
return -EINVAL; \
|
||||
i = (type) string_table_lookup(name##_table, ELEMENTSOF(name##_table), s); \
|
||||
if (i >= 0) \
|
||||
return i; \
|
||||
if (safe_atou(s, &u) < 0) \
|
||||
return -EINVAL; \
|
||||
if (u > max) \
|
||||
return -EINVAL; \
|
||||
return (type) u; \
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name, type, max, scope) \
|
||||
scope type name##_from_string(const char *s) { \
|
||||
return (type) string_table_lookup_from_string_fallback(name##_table, ELEMENTSOF(name##_table), s, max); \
|
||||
}
|
||||
|
||||
#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)
|
||||
#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)
|
||||
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,scope)
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name, type, yes, scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type, scope) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name, type, yes, scope)
|
||||
|
||||
#define DEFINE_STRING_TABLE_LOOKUP(name,type) _DEFINE_STRING_TABLE_LOOKUP(name,type,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name,type) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(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)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP(name, type) _DEFINE_STRING_TABLE_LOOKUP(name, type,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type) _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name, type) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(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)
|
||||
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes) _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes) _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name,type,yes,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name,type,yes,static)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name, type, yes) _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name, type, yes,)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name, type, yes) _DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(name, type, yes, static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name, type, yes) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(name, type, yes, static)
|
||||
|
||||
/* For string conversions where numbers are also acceptable */
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name,type,max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max,) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_FALLBACK(name,type,max) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name, type, max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max,) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name, type, max,)
|
||||
#define DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_FALLBACK(name, type, max) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name, type, max,)
|
||||
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name,type,max,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, static)
|
||||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name, type, max) \
|
||||
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name, type, max, static)
|
||||
|
||||
#define DUMP_STRING_TABLE(name,type,max) \
|
||||
#define DUMP_STRING_TABLE(name, type, max) \
|
||||
({ \
|
||||
flockfile(stdout); \
|
||||
for (type _k = 0; _k < (max); _k++) { \
|
||||
|
||||
@@ -1785,7 +1785,7 @@ DEFINE_STRING_TABLE_LOOKUP_TO_STRING(timestamp_style, TimestampStyle);
|
||||
TimestampStyle timestamp_style_from_string(const char *s) {
|
||||
TimestampStyle t;
|
||||
|
||||
t = (TimestampStyle) string_table_lookup(timestamp_style_table, ELEMENTSOF(timestamp_style_table), s);
|
||||
t = (TimestampStyle) string_table_lookup_from_string(timestamp_style_table, ELEMENTSOF(timestamp_style_table), s);
|
||||
if (t >= 0)
|
||||
return t;
|
||||
if (STRPTR_IN_SET(s, "µs", "μs")) /* accept both µ symbols in unicode, i.e. micro symbol + Greek small letter mu. */
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "namespace-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "kill.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
void kill_context_init(KillContext *c) {
|
||||
assert(c);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "load-dropin.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "random-util.h"
|
||||
#include "scope.h"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "missing_magic.h"
|
||||
#include "pager.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
#include "polkit-agent.h"
|
||||
#include "pretty-print.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "missing_magic.h"
|
||||
#include "missing_mman.h"
|
||||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "quota-util.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "assert-util.h"
|
||||
#include "import-compress.h"
|
||||
#include "log.h"
|
||||
#include "string-table.h"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "microhttpd-util.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-helpers.h"
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "process-util.h"
|
||||
#include "rlimit-util.h"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "mount-util.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "static-destruct.h"
|
||||
#include "string-table.h"
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "lookup3.h"
|
||||
#include "memory-util.h"
|
||||
#include "missing_fs.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "prioq.h"
|
||||
#include "random-util.h"
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "memory-util.h"
|
||||
#include "memstream-util.h"
|
||||
#include "ordered-set.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "ratelimit.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "netlink-util.h"
|
||||
#include "networkd-manager.h"
|
||||
#include "parse-helpers.h"
|
||||
#include "parse-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include "networkd-state-file.h"
|
||||
#include "networkd-sysctl.h"
|
||||
#include "networkd-wifi.h"
|
||||
#include "parse-util.h"
|
||||
#include "set.h"
|
||||
#include "socket-util.h"
|
||||
#include "stdio-util.h"
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "openssl-util.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-helpers.h"
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "proc-cmdline.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "missing_syscall.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "nulstr-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-lookup.h"
|
||||
#include "plymouth-util.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "fileio.h"
|
||||
#include "find-esp.h"
|
||||
#include "log.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pe-binary.h"
|
||||
#include "pretty-print.h"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "fd-util.h"
|
||||
#include "memory-util.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "serialize.h"
|
||||
#include "string-table.h"
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
#include "extract-word.h"
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
#include "parse-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "unaligned.h"
|
||||
#include "virt.h"
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "log.h"
|
||||
#include "macro-fundamental.h"
|
||||
#include "memory-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
|
||||
@@ -505,7 +505,7 @@ ExecCommandFlags exec_command_flags_from_string(const char *s) {
|
||||
if (streq(s, "ambient")) /* Compatibility with ambient hack, removed in v258, map to no bits set */
|
||||
return 0;
|
||||
|
||||
idx = string_table_lookup(exec_command_strings, ELEMENTSOF(exec_command_strings), s);
|
||||
idx = string_table_lookup_from_string(exec_command_strings, ELEMENTSOF(exec_command_strings), s);
|
||||
if (idx < 0)
|
||||
return _EXEC_COMMAND_FLAGS_INVALID;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "macro.h"
|
||||
#include "netlink-internal.h"
|
||||
#include "netlink-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-table.h"
|
||||
#include "time-util.h"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "macro.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "numa-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-table.h"
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "format-table.h"
|
||||
#include "log.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "stdio-util.h"
|
||||
|
||||
@@ -539,7 +539,7 @@ int uki_hash(int fd,
|
||||
if (!n)
|
||||
return log_oom_debug();
|
||||
|
||||
i = string_table_lookup(unified_sections, _UNIFIED_SECTION_MAX, n);
|
||||
i = string_table_lookup_from_string(unified_sections, _UNIFIED_SECTION_MAX, n);
|
||||
if (i < 0)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "output-mode.h"
|
||||
#include "pager.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "mkdir-label.h"
|
||||
#include "notify-recv.h"
|
||||
#include "os-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "service-util.h"
|
||||
#include "signal-util.h"
|
||||
|
||||
Reference in New Issue
Block a user