string-table: Introduce DECLARE_STRING_TABLE_LOOKUP() and friends
Let's introduce these for the following two reasons: - Using them makes sure the parameter names match between declaration and definition (if both use the corresponding macros). - They make sure developers can't forget the _const_ and _pure_ attributes for the declarations. This commit also includes some include sorting fixes
This commit is contained in:
committed by
Yu Watanabe
parent
daff8ea8bb
commit
aec52c1e6e
@@ -19,5 +19,4 @@ int verify_prepare_filename(const char *filename, char **ret);
|
||||
int verify_executable(Unit *u, const ExecCommand *exec, const char *root);
|
||||
int verify_units(char **filenames, RuntimeScope scope, bool check_man, bool run_generators, RecursiveErrors recursive_errors, const char *root);
|
||||
|
||||
const char* recursive_errors_to_string(RecursiveErrors i) _const_;
|
||||
RecursiveErrors recursive_errors_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(recursive_errors, RecursiveErrors);
|
||||
|
||||
@@ -13,8 +13,7 @@ typedef enum ColorMode {
|
||||
_COLOR_MODE_INVALID = -EINVAL,
|
||||
} ColorMode;
|
||||
|
||||
const char* color_mode_to_string(ColorMode m) _const_;
|
||||
ColorMode color_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(color_mode, ColorMode);
|
||||
|
||||
ColorMode get_color_mode(void);
|
||||
static inline bool colors_enabled(void) {
|
||||
|
||||
@@ -242,5 +242,4 @@ Architecture uname_architecture(void);
|
||||
# error "Please register your architecture here!"
|
||||
#endif
|
||||
|
||||
const char* architecture_to_string(Architecture a) _const_;
|
||||
Architecture architecture_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(architecture, Architecture);
|
||||
|
||||
+14
-13
@@ -3,20 +3,21 @@
|
||||
|
||||
/* IWYU pragma: always_keep */
|
||||
|
||||
#include <errno.h> /* IWYU pragma: export */
|
||||
#include <inttypes.h> /* IWYU pragma: export */
|
||||
#include <limits.h> /* IWYU pragma: export */
|
||||
#include <paths.h> /* IWYU pragma: export */
|
||||
#include <stdarg.h> /* IWYU pragma: export */
|
||||
#include <stdbool.h> /* IWYU pragma: export */
|
||||
#include <stddef.h> /* IWYU pragma: export */
|
||||
#include <stdint.h> /* IWYU pragma: export */
|
||||
#include <sys/types.h> /* IWYU pragma: export */
|
||||
#include <uchar.h> /* IWYU pragma: export */
|
||||
#include <errno.h> /* IWYU pragma: export */
|
||||
#include <inttypes.h> /* IWYU pragma: export */
|
||||
#include <limits.h> /* IWYU pragma: export */
|
||||
#include <paths.h> /* IWYU pragma: export */
|
||||
#include <stdarg.h> /* IWYU pragma: export */
|
||||
#include <stdbool.h> /* IWYU pragma: export */
|
||||
#include <stddef.h> /* IWYU pragma: export */
|
||||
#include <stdint.h> /* IWYU pragma: export */
|
||||
#include <sys/types.h> /* IWYU pragma: export */
|
||||
#include <uchar.h> /* IWYU pragma: export */
|
||||
|
||||
#include "assert-util.h" /* IWYU pragma: export */
|
||||
#include "cleanup-util.h" /* IWYU pragma: export */
|
||||
#include "macro.h" /* IWYU pragma: export */
|
||||
#include "assert-util.h" /* IWYU pragma: export */
|
||||
#include "cleanup-util.h" /* IWYU pragma: export */
|
||||
#include "macro.h" /* IWYU pragma: export */
|
||||
#include "string-table-fundamental.h" /* IWYU pragma: export */
|
||||
|
||||
/* Generic types */
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@ typedef enum CGroupIOLimitType {
|
||||
|
||||
extern const uint64_t cgroup_io_limit_defaults[_CGROUP_IO_LIMIT_TYPE_MAX];
|
||||
|
||||
const char* cgroup_io_limit_type_to_string(CGroupIOLimitType t) _const_;
|
||||
CGroupIOLimitType cgroup_io_limit_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_io_limit_type, CGroupIOLimitType);
|
||||
void cgroup_io_limits_list(void);
|
||||
|
||||
/* Special values for the io.bfq.weight attribute */
|
||||
@@ -243,8 +242,7 @@ int cg_mask_to_string(CGroupMask mask, char **ret);
|
||||
|
||||
bool cg_kill_supported(void);
|
||||
|
||||
const char* cgroup_controller_to_string(CGroupController c) _const_;
|
||||
CGroupController cgroup_controller_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_controller, CGroupController);
|
||||
|
||||
typedef enum ManagedOOMMode {
|
||||
MANAGED_OOM_AUTO,
|
||||
@@ -253,8 +251,7 @@ typedef enum ManagedOOMMode {
|
||||
_MANAGED_OOM_MODE_INVALID = -EINVAL,
|
||||
} ManagedOOMMode;
|
||||
|
||||
const char* managed_oom_mode_to_string(ManagedOOMMode m) _const_;
|
||||
ManagedOOMMode managed_oom_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(managed_oom_mode, ManagedOOMMode);
|
||||
|
||||
typedef enum ManagedOOMPreference {
|
||||
MANAGED_OOM_PREFERENCE_NONE = 0,
|
||||
@@ -264,5 +261,4 @@ typedef enum ManagedOOMPreference {
|
||||
_MANAGED_OOM_PREFERENCE_INVALID = -EINVAL,
|
||||
} ManagedOOMPreference;
|
||||
|
||||
const char* managed_oom_preference_to_string(ManagedOOMPreference a) _const_;
|
||||
ManagedOOMPreference managed_oom_preference_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(managed_oom_preference, ManagedOOMPreference);
|
||||
|
||||
@@ -12,10 +12,8 @@ typedef enum Compression {
|
||||
_COMPRESSION_INVALID = -EINVAL,
|
||||
} Compression;
|
||||
|
||||
const char* compression_to_string(Compression compression) _const_;
|
||||
Compression compression_from_string(const char *s) _pure_;
|
||||
const char* compression_lowercase_to_string(Compression compression) _const_;
|
||||
Compression compression_lowercase_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(compression, Compression);
|
||||
DECLARE_STRING_TABLE_LOOKUP(compression_lowercase, Compression);
|
||||
|
||||
bool compression_supported(Compression c);
|
||||
|
||||
|
||||
@@ -20,5 +20,4 @@ typedef enum ConfidentialVirtualization {
|
||||
|
||||
ConfidentialVirtualization detect_confidential_virtualization(void);
|
||||
|
||||
const char* confidential_virtualization_to_string(ConfidentialVirtualization v) _const_;
|
||||
ConfidentialVirtualization confidential_virtualization_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(confidential_virtualization, ConfidentialVirtualization);
|
||||
|
||||
@@ -36,8 +36,7 @@ int locale_is_installed(const char *name);
|
||||
|
||||
bool is_locale_utf8(void);
|
||||
|
||||
const char* locale_variable_to_string(LocaleVariable i) _const_;
|
||||
LocaleVariable locale_variable_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(locale_variable, LocaleVariable);
|
||||
|
||||
static inline void freelocalep(locale_t *p) {
|
||||
if (*p == (locale_t) 0)
|
||||
|
||||
+1
-2
@@ -40,8 +40,7 @@ static inline void clear_log_syntax_callback(dummy_t *dummy) {
|
||||
set_log_syntax_callback(/* cb= */ NULL, /* userdata= */ NULL);
|
||||
}
|
||||
|
||||
const char* log_target_to_string(LogTarget target) _const_;
|
||||
LogTarget log_target_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(log_target, LogTarget);
|
||||
void log_set_target(LogTarget target);
|
||||
void log_set_target_and_open(LogTarget target);
|
||||
int log_set_target_from_string(const char *e);
|
||||
|
||||
+1
-2
@@ -14,8 +14,7 @@ typedef enum ImageClass {
|
||||
_IMAGE_CLASS_INVALID = -EINVAL,
|
||||
} ImageClass;
|
||||
|
||||
const char* image_class_to_string(ImageClass cl) _const_;
|
||||
ImageClass image_class_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(image_class, ImageClass);
|
||||
|
||||
/* The *_extension_release flavours will look for /usr/lib/extension-release/extension-release.NAME
|
||||
* for sysext images and for /etc/extension-release.d/extension-release.NAME for confext images
|
||||
|
||||
@@ -107,11 +107,8 @@ const char* personality_to_string(unsigned long);
|
||||
int safe_personality(unsigned long p);
|
||||
int opinionated_personality(unsigned long *ret);
|
||||
|
||||
const char* sigchld_code_to_string(int i) _const_;
|
||||
int sigchld_code_from_string(const char *s) _pure_;
|
||||
|
||||
int sched_policy_to_string_alloc(int i, char **ret);
|
||||
int sched_policy_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP(sigchld_code, int);
|
||||
DECLARE_STRING_TABLE_LOOKUP_WITH_FALLBACK(sched_policy, int);
|
||||
|
||||
static inline pid_t PTR_TO_PID(const void *p) {
|
||||
return (pid_t) ((uintptr_t) p);
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#define _RLIMIT_MAX RLIMIT_NLIMITS
|
||||
|
||||
const char* rlimit_to_string(int i) _const_;
|
||||
int rlimit_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(rlimit, int);
|
||||
int rlimit_from_string_harder(const char *s) _pure_;
|
||||
void rlimits_list(const char *prefix);
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ typedef enum RuntimeScope {
|
||||
_RUNTIME_SCOPE_INVALID = -EINVAL,
|
||||
} RuntimeScope;
|
||||
|
||||
const char* runtime_scope_to_string(RuntimeScope scope) _const_;
|
||||
RuntimeScope runtime_scope_from_string(const char *s) _const_;
|
||||
|
||||
const char* runtime_scope_cmdline_option_to_string(RuntimeScope scope) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(runtime_scope, RuntimeScope);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(runtime_scope_cmdline_option, RuntimeScope);
|
||||
|
||||
static inline mode_t runtime_scope_to_socket_mode(RuntimeScope scope) {
|
||||
/* Returns the right socket mode to use for binding AF_UNIX sockets intended for the specified
|
||||
|
||||
@@ -31,8 +31,7 @@ int sigset_add_many_internal(sigset_t *ss, ...);
|
||||
int sigprocmask_many_internal(int how, sigset_t *ret_old_mask, ...);
|
||||
#define sigprocmask_many(...) sigprocmask_many_internal(__VA_ARGS__, -1)
|
||||
|
||||
const char* signal_to_string(int signo) _const_;
|
||||
int signal_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(signal, int);
|
||||
|
||||
void nop_signal_handler(int sig);
|
||||
|
||||
|
||||
@@ -55,8 +55,7 @@ typedef struct SocketAddress {
|
||||
|
||||
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family)
|
||||
|
||||
const char* socket_address_type_to_string(int t) _const_;
|
||||
int socket_address_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(socket_address_type, int);
|
||||
|
||||
int sockaddr_un_unlink(const struct sockaddr_un *sa);
|
||||
|
||||
@@ -87,8 +86,7 @@ int getsockname_pretty(int fd, char **ret);
|
||||
|
||||
int socknameinfo_pretty(const struct sockaddr *sa, socklen_t salen, char **_ret);
|
||||
|
||||
int netlink_family_to_string_alloc(int i, char **ret);
|
||||
int netlink_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_WITH_FALLBACK(netlink_family, int);
|
||||
|
||||
bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b);
|
||||
|
||||
@@ -101,8 +99,7 @@ static inline int fd_increase_rxbuf(int fd, size_t n) {
|
||||
return fd_set_rcvbuf(fd, n, true);
|
||||
}
|
||||
|
||||
int ip_tos_to_string_alloc(int i, char **ret);
|
||||
int ip_tos_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP_WITH_FALLBACK(ip_tos, int);
|
||||
|
||||
typedef enum {
|
||||
IFNAME_VALID_ALTERNATIVE = 1 << 0, /* Allow "altnames" too */
|
||||
|
||||
@@ -97,8 +97,7 @@ void inode_hash_func(const struct stat *q, struct siphash *state);
|
||||
int inode_compare_func(const struct stat *a, const struct stat *b);
|
||||
extern const struct hash_ops inode_hash_ops;
|
||||
|
||||
const char* inode_type_to_string(mode_t m) _const_;
|
||||
mode_t inode_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(inode_type, mode_t);
|
||||
|
||||
/* Macros that check whether the stat/statx structures have been initialized already. For "struct stat" we
|
||||
* use a check for .st_dev being non-zero, since the kernel unconditionally fills that in, mapping the file
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
|
||||
#include "basic-forward.h"
|
||||
|
||||
int log_facility_unshifted_to_string_alloc(int i, char **ret);
|
||||
int log_facility_unshifted_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP_WITH_FALLBACK(log_facility_unshifted, int);
|
||||
bool log_facility_unshifted_is_valid(int faciliy);
|
||||
|
||||
int log_level_to_string_alloc(int i, char **ret);
|
||||
int log_level_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP_WITH_FALLBACK(log_level, int);
|
||||
bool log_level_is_valid(int level);
|
||||
|
||||
int syslog_parse_priority(const char **p, int *priority, bool with_facility);
|
||||
|
||||
@@ -232,5 +232,4 @@ int usleep_safe(usec_t usec);
|
||||
|
||||
int time_change_fd(void);
|
||||
|
||||
const char* timestamp_style_to_string(TimestampStyle t) _const_;
|
||||
TimestampStyle timestamp_style_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(timestamp_style, TimestampStyle);
|
||||
|
||||
+20
-40
@@ -313,67 +313,47 @@ int unit_name_from_dbus_path(const char *path, char **name);
|
||||
const char* unit_dbus_interface_from_type(UnitType t);
|
||||
const char* unit_dbus_interface_from_name(const char *name);
|
||||
|
||||
const char* unit_type_to_string(UnitType i) _const_;
|
||||
UnitType unit_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(unit_type, UnitType);
|
||||
void unit_types_list(void);
|
||||
|
||||
const char* unit_load_state_to_string(UnitLoadState i) _const_;
|
||||
UnitLoadState unit_load_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(unit_load_state, UnitLoadState);
|
||||
|
||||
const char* unit_active_state_to_string(UnitActiveState i) _const_;
|
||||
UnitActiveState unit_active_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(unit_active_state, UnitActiveState);
|
||||
|
||||
const char* freezer_state_to_string(FreezerState i) _const_;
|
||||
FreezerState freezer_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(freezer_state, FreezerState);
|
||||
FreezerState freezer_state_finish(FreezerState state) _const_;
|
||||
FreezerState freezer_state_objective(FreezerState state) _const_;
|
||||
|
||||
const char* unit_marker_to_string(UnitMarker m) _const_;
|
||||
UnitMarker unit_marker_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(unit_marker, UnitMarker);
|
||||
|
||||
const char* automount_state_to_string(AutomountState i) _const_;
|
||||
AutomountState automount_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(automount_state, AutomountState);
|
||||
|
||||
const char* device_state_to_string(DeviceState i) _const_;
|
||||
DeviceState device_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(device_state, DeviceState);
|
||||
|
||||
const char* mount_state_to_string(MountState i) _const_;
|
||||
MountState mount_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(mount_state, MountState);
|
||||
|
||||
const char* path_state_to_string(PathState i) _const_;
|
||||
PathState path_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(path_state, PathState);
|
||||
|
||||
const char* scope_state_to_string(ScopeState i) _const_;
|
||||
ScopeState scope_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(scope_state, ScopeState);
|
||||
|
||||
const char* service_state_to_string(ServiceState i) _const_;
|
||||
ServiceState service_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_state, ServiceState);
|
||||
|
||||
const char* slice_state_to_string(SliceState i) _const_;
|
||||
SliceState slice_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(slice_state, SliceState);
|
||||
|
||||
const char* socket_state_to_string(SocketState i) _const_;
|
||||
SocketState socket_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(socket_state, SocketState);
|
||||
|
||||
const char* swap_state_to_string(SwapState i) _const_;
|
||||
SwapState swap_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(swap_state, SwapState);
|
||||
|
||||
const char* target_state_to_string(TargetState i) _const_;
|
||||
TargetState target_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(target_state, TargetState);
|
||||
|
||||
const char* timer_state_to_string(TimerState i) _const_;
|
||||
TimerState timer_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(timer_state, TimerState);
|
||||
|
||||
const char* unit_dependency_to_string(UnitDependency i) _const_;
|
||||
UnitDependency unit_dependency_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency);
|
||||
|
||||
const char* notify_access_to_string(NotifyAccess i) _const_;
|
||||
NotifyAccess notify_access_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(notify_access, NotifyAccess);
|
||||
|
||||
const char* job_mode_to_string(JobMode t) _const_;
|
||||
JobMode job_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(job_mode, JobMode);
|
||||
|
||||
const char* exec_directory_type_to_string(ExecDirectoryType i) _const_;
|
||||
ExecDirectoryType exec_directory_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_directory_type, ExecDirectoryType);
|
||||
|
||||
Glyph unit_active_state_to_glyph(UnitActiveState state);
|
||||
|
||||
+1
-2
@@ -62,6 +62,5 @@ Virtualization detect_virtualization(void);
|
||||
int running_in_userns(void);
|
||||
int running_in_chroot(void);
|
||||
|
||||
const char* virtualization_to_string(Virtualization v) _const_;
|
||||
Virtualization virtualization_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(virtualization, Virtualization);
|
||||
bool has_cpu_with_flag(const char *flag);
|
||||
|
||||
+1
-2
@@ -34,8 +34,7 @@ typedef enum LogLevel {
|
||||
_LOG_INVALID = -1,
|
||||
} LogLevel;
|
||||
|
||||
LogLevel log_level_from_string(const char *s) _pure_;
|
||||
const char* log_level_to_string(LogLevel l) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(log_level, LogLevel);
|
||||
|
||||
LogLevel log_get_max_level(void) _pure_;
|
||||
int log_set_max_level(LogLevel level);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "cleanup-fundamental.h" /* IWYU pragma: export */
|
||||
#include "efi-fundamental.h" /* IWYU pragma: export */
|
||||
#include "macro-fundamental.h" /* IWYU pragma: export */
|
||||
#include "string-table-fundamental.h" /* IWYU pragma: export */
|
||||
|
||||
#if SD_BOOT
|
||||
/* uchar.h/wchar.h are not suitable for freestanding environments. */
|
||||
|
||||
@@ -41,5 +41,5 @@ void install_security_override(security_validator_t validator, const void *valid
|
||||
void uninstall_security_override(void);
|
||||
bool security_override_available(void);
|
||||
|
||||
const char* secure_boot_enroll_to_string(secure_boot_enroll e) _const_;
|
||||
const char* secure_boot_enroll_action_to_string(secure_boot_enroll_action e) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(secure_boot_enroll, secure_boot_enroll);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(secure_boot_enroll_action, secure_boot_enroll_action);
|
||||
|
||||
@@ -38,7 +38,6 @@ typedef struct Automount {
|
||||
|
||||
extern const UnitVTable automount_vtable;
|
||||
|
||||
const char* automount_result_to_string(AutomountResult i) _const_;
|
||||
AutomountResult automount_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(automount_result, AutomountResult);
|
||||
|
||||
DEFINE_CAST(AUTOMOUNT, Automount);
|
||||
|
||||
+8
-16
@@ -450,8 +450,7 @@ void unit_invalidate_cgroup_bpf_firewall(Unit *u);
|
||||
|
||||
void manager_invalidate_startup_units(Manager *m);
|
||||
|
||||
const char* cgroup_device_policy_to_string(CGroupDevicePolicy i) _const_;
|
||||
CGroupDevicePolicy cgroup_device_policy_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_device_policy, CGroupDevicePolicy);
|
||||
|
||||
void unit_cgroup_catchup(Unit *u);
|
||||
|
||||
@@ -461,8 +460,7 @@ int unit_get_cpuset(Unit *u, CPUSet *cpus, const char *name);
|
||||
|
||||
int unit_cgroup_freezer_action(Unit *u, FreezerAction action);
|
||||
|
||||
const char* freezer_action_to_string(FreezerAction a) _const_;
|
||||
FreezerAction freezer_action_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(freezer_action, FreezerAction);
|
||||
|
||||
CGroupRuntime* cgroup_runtime_new(void);
|
||||
CGroupRuntime* cgroup_runtime_free(CGroupRuntime *crt);
|
||||
@@ -471,20 +469,14 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(CGroupRuntime*, cgroup_runtime_free);
|
||||
int cgroup_runtime_serialize(Unit *u, FILE *f, FDSet *fds);
|
||||
int cgroup_runtime_deserialize_one(Unit *u, const char *key, const char *value, FDSet *fds);
|
||||
|
||||
const char* cgroup_pressure_watch_to_string(CGroupPressureWatch a) _const_;
|
||||
CGroupPressureWatch cgroup_pressure_watch_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_pressure_watch, CGroupPressureWatch);
|
||||
|
||||
const char* cgroup_device_permissions_to_string(CGroupDevicePermissions p) _const_;
|
||||
CGroupDevicePermissions cgroup_device_permissions_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_device_permissions, CGroupDevicePermissions);
|
||||
|
||||
const char* cgroup_ip_accounting_metric_to_string(CGroupIPAccountingMetric m) _const_;
|
||||
CGroupIPAccountingMetric cgroup_ip_accounting_metric_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_ip_accounting_metric, CGroupIPAccountingMetric);
|
||||
|
||||
const char* cgroup_io_accounting_metric_to_string(CGroupIOAccountingMetric m) _const_;
|
||||
CGroupIOAccountingMetric cgroup_io_accounting_metric_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_io_accounting_metric, CGroupIOAccountingMetric);
|
||||
|
||||
const char* cgroup_effective_limit_type_to_string(CGroupLimitType m) _const_;
|
||||
CGroupLimitType cgroup_effective_limit_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_effective_limit_type, CGroupLimitType);
|
||||
|
||||
const char* cgroup_memory_accounting_metric_to_string(CGroupMemoryAccountingMetric m) _const_;
|
||||
CGroupMemoryAccountingMetric cgroup_memory_accounting_metric_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(cgroup_memory_accounting_metric, CGroupMemoryAccountingMetric);
|
||||
|
||||
@@ -11,8 +11,7 @@ typedef enum CrashAction {
|
||||
_CRASH_ACTION_INVALID = -EINVAL,
|
||||
} CrashAction;
|
||||
|
||||
const char* crash_action_to_string(CrashAction action);
|
||||
CrashAction crash_action_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP(crash_action, CrashAction);
|
||||
|
||||
_noreturn_ void freeze_or_exit_or_reboot(void);
|
||||
void install_crash_handler(void);
|
||||
|
||||
@@ -40,7 +40,6 @@ void emergency_action(
|
||||
int exit_status,
|
||||
const char *reason);
|
||||
|
||||
const char* emergency_action_to_string(EmergencyAction i) _const_;
|
||||
EmergencyAction emergency_action_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(emergency_action, EmergencyAction);
|
||||
|
||||
int parse_emergency_action(const char *value, RuntimeScope runtime_scope, EmergencyAction *ret);
|
||||
|
||||
+9
-17
@@ -597,31 +597,23 @@ int exec_directory_add(ExecDirectory *d, const char *path, const char *symlink,
|
||||
void exec_directory_sort(ExecDirectory *d);
|
||||
bool exec_directory_is_private(const ExecContext *context, ExecDirectoryType type);
|
||||
|
||||
ExecCleanMask exec_clean_mask_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(exec_clean_mask, ExecCleanMask);
|
||||
|
||||
const char* exec_output_to_string(ExecOutput i) _const_;
|
||||
ExecOutput exec_output_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_output, ExecOutput);
|
||||
|
||||
const char* exec_input_to_string(ExecInput i) _const_;
|
||||
ExecInput exec_input_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_input, ExecInput);
|
||||
|
||||
const char* exec_utmp_mode_to_string(ExecUtmpMode i) _const_;
|
||||
ExecUtmpMode exec_utmp_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_utmp_mode, ExecUtmpMode);
|
||||
|
||||
const char* exec_preserve_mode_to_string(ExecPreserveMode i) _const_;
|
||||
ExecPreserveMode exec_preserve_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_preserve_mode, ExecPreserveMode);
|
||||
|
||||
const char* exec_keyring_mode_to_string(ExecKeyringMode i) _const_;
|
||||
ExecKeyringMode exec_keyring_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_keyring_mode, ExecKeyringMode);
|
||||
|
||||
const char* exec_directory_type_symlink_to_string(ExecDirectoryType i) _const_;
|
||||
ExecDirectoryType exec_directory_type_symlink_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_directory_type_symlink, ExecDirectoryType);
|
||||
|
||||
const char* exec_directory_type_mode_to_string(ExecDirectoryType i) _const_;
|
||||
ExecDirectoryType exec_directory_type_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_directory_type_mode, ExecDirectoryType);
|
||||
|
||||
const char* exec_resource_type_to_string(ExecDirectoryType i) _const_;
|
||||
ExecDirectoryType exec_resource_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(exec_resource_type, ExecDirectoryType);
|
||||
|
||||
bool exec_needs_mount_namespace(const ExecContext *context, const ExecParameters *params, const ExecRuntime *runtime);
|
||||
bool exec_needs_network_namespace(const ExecContext *context);
|
||||
|
||||
+3
-6
@@ -209,14 +209,11 @@ void job_add_to_gc_queue(Job *j);
|
||||
int job_get_before(Job *j, Job*** ret);
|
||||
int job_get_after(Job *j, Job*** ret);
|
||||
|
||||
const char* job_type_to_string(JobType t) _const_;
|
||||
JobType job_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(job_type, JobType);
|
||||
|
||||
const char* job_state_to_string(JobState t) _const_;
|
||||
JobState job_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(job_state, JobState);
|
||||
|
||||
const char* job_result_to_string(JobResult t) _const_;
|
||||
JobResult job_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(job_result, JobResult);
|
||||
|
||||
const char* job_type_to_access_method(JobType t);
|
||||
|
||||
|
||||
+2
-4
@@ -40,11 +40,9 @@ typedef enum KillWhom {
|
||||
void kill_context_init(KillContext *c);
|
||||
void kill_context_dump(KillContext *c, FILE *f, const char *prefix);
|
||||
|
||||
const char* kill_mode_to_string(KillMode k) _const_;
|
||||
KillMode kill_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(kill_mode, KillMode);
|
||||
|
||||
const char* kill_whom_to_string(KillWhom k) _const_;
|
||||
KillWhom kill_whom_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(kill_whom, KillWhom);
|
||||
|
||||
static inline int restart_kill_signal(const KillContext *c) {
|
||||
if (c->restart_kill_signal != 0)
|
||||
|
||||
+3
-6
@@ -625,14 +625,11 @@ void manager_restore_original_log_target(Manager *m);
|
||||
const char* manager_get_confirm_spawn(Manager *m);
|
||||
void manager_disable_confirm_spawn(void);
|
||||
|
||||
const char* manager_state_to_string(ManagerState m) _const_;
|
||||
ManagerState manager_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(manager_state, ManagerState);
|
||||
|
||||
const char* manager_objective_to_string(ManagerObjective m) _const_;
|
||||
ManagerObjective manager_objective_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(manager_objective, ManagerObjective);
|
||||
|
||||
const char* manager_timestamp_to_string(ManagerTimestamp m) _const_;
|
||||
ManagerTimestamp manager_timestamp_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(manager_timestamp, ManagerTimestamp);
|
||||
ManagerTimestamp manager_timestamp_initrd_mangle(ManagerTimestamp s);
|
||||
|
||||
usec_t manager_get_watchdog(Manager *m, WatchdogType t);
|
||||
|
||||
+2
-4
@@ -99,10 +99,8 @@ char* mount_get_what_escaped(const Mount *m);
|
||||
char* mount_get_options_escaped(const Mount *m);
|
||||
const char* mount_get_fstype(const Mount *m);
|
||||
|
||||
const char* mount_exec_command_to_string(MountExecCommand i) _const_;
|
||||
MountExecCommand mount_exec_command_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(mount_exec_command, MountExecCommand);
|
||||
|
||||
const char* mount_result_to_string(MountResult i) _const_;
|
||||
MountResult mount_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(mount_result, MountResult);
|
||||
|
||||
DEFINE_CAST(MOUNT, Mount);
|
||||
|
||||
+14
-28
@@ -221,35 +221,25 @@ int setup_tmp_dirs(
|
||||
int setup_shareable_ns(int ns_storage_socket[static 2], unsigned long nsflag);
|
||||
int open_shareable_ns_path(int netns_storage_socket[static 2], const char *path, unsigned long nsflag);
|
||||
|
||||
const char* protect_home_to_string(ProtectHome p) _const_;
|
||||
ProtectHome protect_home_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(protect_home, ProtectHome);
|
||||
|
||||
const char* protect_hostname_to_string(ProtectHostname p) _const_;
|
||||
ProtectHostname protect_hostname_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(protect_hostname, ProtectHostname);
|
||||
|
||||
const char* protect_system_to_string(ProtectSystem p) _const_;
|
||||
ProtectSystem protect_system_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(protect_system, ProtectSystem);
|
||||
|
||||
const char* protect_proc_to_string(ProtectProc i) _const_;
|
||||
ProtectProc protect_proc_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(protect_proc, ProtectProc);
|
||||
|
||||
const char* proc_subset_to_string(ProcSubset i) _const_;
|
||||
ProcSubset proc_subset_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(proc_subset, ProcSubset);
|
||||
|
||||
const char* private_bpf_to_string(PrivateBPF i) _const_;
|
||||
PrivateBPF private_bpf_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(private_bpf, PrivateBPF);
|
||||
|
||||
const char* bpf_delegate_cmd_to_string(uint64_t u) _const_;
|
||||
uint64_t bpf_delegate_cmd_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bpf_delegate_cmd, uint64_t);
|
||||
|
||||
const char* bpf_delegate_map_type_to_string(uint64_t u) _const_;
|
||||
uint64_t bpf_delegate_map_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bpf_delegate_map_type, uint64_t);
|
||||
|
||||
const char* bpf_delegate_prog_type_to_string(uint64_t u) _const_;
|
||||
uint64_t bpf_delegate_prog_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bpf_delegate_prog_type, uint64_t);
|
||||
|
||||
const char* bpf_delegate_attach_type_to_string(uint64_t u) _const_;
|
||||
uint64_t bpf_delegate_attach_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bpf_delegate_attach_type, uint64_t);
|
||||
|
||||
char* bpf_delegate_to_string(uint64_t u, const char * (*parser)(uint64_t) _const_);
|
||||
int bpf_delegate_from_string(const char *s, uint64_t *ret, uint64_t (*parser)(const char *));
|
||||
@@ -286,17 +276,13 @@ static inline char * bpf_delegate_attachments_to_string(uint64_t u) {
|
||||
return bpf_delegate_to_string(u, bpf_delegate_attach_type_to_string);
|
||||
}
|
||||
|
||||
const char* private_tmp_to_string(PrivateTmp i) _const_;
|
||||
PrivateTmp private_tmp_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(private_tmp, PrivateTmp);
|
||||
|
||||
const char* private_users_to_string(PrivateUsers i) _const_;
|
||||
PrivateUsers private_users_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(private_users, PrivateUsers);
|
||||
|
||||
const char* protect_control_groups_to_string(ProtectControlGroups i) _const_;
|
||||
ProtectControlGroups protect_control_groups_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(protect_control_groups, ProtectControlGroups);
|
||||
|
||||
const char* private_pids_to_string(PrivatePIDs i) _const_;
|
||||
PrivatePIDs private_pids_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(private_pids, PrivatePIDs);
|
||||
|
||||
void bind_mount_free_many(BindMount *b, size_t n);
|
||||
int bind_mount_add(BindMount **b, size_t *n, const BindMount *item);
|
||||
|
||||
+2
-4
@@ -76,11 +76,9 @@ void path_free_specs(Path *p);
|
||||
extern const UnitVTable path_vtable;
|
||||
extern const ActivationDetailsVTable activation_details_path_vtable;
|
||||
|
||||
const char* path_type_to_string(PathType i) _const_;
|
||||
PathType path_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(path_type, PathType);
|
||||
|
||||
const char* path_result_to_string(PathResult i) _const_;
|
||||
PathResult path_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(path_result, PathResult);
|
||||
|
||||
DEFINE_CAST(PATH, Path);
|
||||
DEFINE_ACTIVATION_DETAILS_CAST(ACTIVATION_DETAILS_PATH, ActivationDetailsPath, PATH);
|
||||
|
||||
+1
-2
@@ -46,7 +46,6 @@ extern const UnitVTable scope_vtable;
|
||||
|
||||
int scope_abandon(Scope *s);
|
||||
|
||||
const char* scope_result_to_string(ScopeResult i) _const_;
|
||||
ScopeResult scope_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(scope_result, ScopeResult);
|
||||
|
||||
DEFINE_CAST(SCOPE, Scope);
|
||||
|
||||
+9
-18
@@ -270,32 +270,23 @@ usec_t service_restart_usec_next(const Service *s) _pure_;
|
||||
|
||||
int service_determine_exec_selinux_label(Service *s, char **ret);
|
||||
|
||||
const char* service_restart_to_string(ServiceRestart i) _const_;
|
||||
ServiceRestart service_restart_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_restart, ServiceRestart);
|
||||
|
||||
const char* service_restart_mode_to_string(ServiceRestartMode i) _const_;
|
||||
ServiceRestartMode service_restart_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_restart_mode, ServiceRestartMode);
|
||||
|
||||
const char* service_type_to_string(ServiceType i) _const_;
|
||||
ServiceType service_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_type, ServiceType);
|
||||
|
||||
const char* service_exit_type_to_string(ServiceExitType i) _const_;
|
||||
ServiceExitType service_exit_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_exit_type, ServiceExitType);
|
||||
|
||||
const char* service_exec_command_to_string(ServiceExecCommand i) _const_;
|
||||
ServiceExecCommand service_exec_command_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_exec_command, ServiceExecCommand);
|
||||
|
||||
const char* service_exec_ex_command_to_string(ServiceExecCommand i) _const_;
|
||||
ServiceExecCommand service_exec_ex_command_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_exec_ex_command, ServiceExecCommand);
|
||||
|
||||
const char* notify_state_to_string(NotifyState i) _const_;
|
||||
NotifyState notify_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(notify_state, NotifyState);
|
||||
|
||||
const char* service_result_to_string(ServiceResult i) _const_;
|
||||
ServiceResult service_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_result, ServiceResult);
|
||||
|
||||
const char* service_timeout_failure_mode_to_string(ServiceTimeoutFailureMode i) _const_;
|
||||
ServiceTimeoutFailureMode service_timeout_failure_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(service_timeout_failure_mode, ServiceTimeoutFailureMode);
|
||||
|
||||
DEFINE_CAST(SERVICE, Service);
|
||||
|
||||
|
||||
@@ -31,12 +31,10 @@ typedef enum StatusUnitFormat {
|
||||
static inline bool show_status_on(ShowStatus s) {
|
||||
return IN_SET(s, SHOW_STATUS_TEMPORARY, SHOW_STATUS_YES);
|
||||
}
|
||||
ShowStatus show_status_from_string(const char *s) _const_;
|
||||
const char* show_status_to_string(ShowStatus s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(show_status, ShowStatus);
|
||||
int parse_show_status(const char *s, ShowStatus *ret);
|
||||
|
||||
StatusUnitFormat status_unit_format_from_string(const char *s) _const_;
|
||||
const char* status_unit_format_to_string(StatusUnitFormat s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(status_unit_format, StatusUnitFormat);
|
||||
|
||||
int status_vprintf(const char *status, ShowStatusFlags flags, const char *format, va_list ap) _printf_(3,0);
|
||||
int status_printf(const char *status, ShowStatusFlags flags, const char *format, ...) _printf_(3,4);
|
||||
|
||||
+4
-8
@@ -204,20 +204,16 @@ const char* socket_fdname(Socket *s);
|
||||
|
||||
extern const UnitVTable socket_vtable;
|
||||
|
||||
const char* socket_exec_command_to_string(SocketExecCommand i) _const_;
|
||||
SocketExecCommand socket_exec_command_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(socket_exec_command, SocketExecCommand);
|
||||
|
||||
const char* socket_result_to_string(SocketResult i) _const_;
|
||||
SocketResult socket_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(socket_result, SocketResult);
|
||||
|
||||
const char* socket_port_type_to_string(SocketPort *p) _pure_;
|
||||
SocketType socket_port_type_from_string(const char *s) _pure_;
|
||||
|
||||
const char* socket_timestamping_to_string(SocketTimestamping p) _const_;
|
||||
SocketTimestamping socket_timestamping_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(socket_timestamping, SocketTimestamping);
|
||||
SocketTimestamping socket_timestamping_from_string_harder(const char *s) _pure_;
|
||||
|
||||
const char* socket_defer_trigger_to_string(SocketDeferTrigger i) _const_;
|
||||
SocketDeferTrigger socket_defer_trigger_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(socket_defer_trigger, SocketDeferTrigger);
|
||||
|
||||
DEFINE_CAST(SOCKET, Socket);
|
||||
|
||||
+2
-4
@@ -94,10 +94,8 @@ int swap_process_device_remove(Manager *m, sd_device *dev);
|
||||
int swap_get_priority(const Swap *s);
|
||||
const char* swap_get_options(const Swap *s);
|
||||
|
||||
const char* swap_exec_command_to_string(SwapExecCommand i) _const_;
|
||||
SwapExecCommand swap_exec_command_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(swap_exec_command, SwapExecCommand);
|
||||
|
||||
const char* swap_result_to_string(SwapResult i) _const_;
|
||||
SwapResult swap_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(swap_result, SwapResult);
|
||||
|
||||
DEFINE_CAST(SWAP, Swap);
|
||||
|
||||
+2
-4
@@ -78,13 +78,11 @@ void timer_free_values(Timer *t);
|
||||
extern const UnitVTable timer_vtable;
|
||||
extern const ActivationDetailsVTable activation_details_timer_vtable;
|
||||
|
||||
const char* timer_base_to_string(TimerBase i) _const_;
|
||||
TimerBase timer_base_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(timer_base, TimerBase);
|
||||
|
||||
char* timer_base_to_usec_string(TimerBase i);
|
||||
|
||||
const char* timer_result_to_string(TimerResult i) _const_;
|
||||
TimerResult timer_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(timer_result, TimerResult);
|
||||
|
||||
DEFINE_CAST(TIMER, Timer);
|
||||
DEFINE_ACTIVATION_DETAILS_CAST(ACTIVATION_DETAILS_TIMER, ActivationDetailsTimer, TIMER);
|
||||
|
||||
+3
-6
@@ -1087,12 +1087,10 @@ int unit_compare_priority(Unit *a, Unit *b);
|
||||
const char* unit_log_field(const Unit *u);
|
||||
const char* unit_invocation_log_field(const Unit *u);
|
||||
|
||||
UnitMountDependencyType unit_mount_dependency_type_from_string(const char *s) _const_;
|
||||
const char* unit_mount_dependency_type_to_string(UnitMountDependencyType t) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(unit_mount_dependency_type, UnitMountDependencyType);
|
||||
UnitDependency unit_mount_dependency_type_to_dependency_type(UnitMountDependencyType t) _pure_;
|
||||
|
||||
const char* oom_policy_to_string(OOMPolicy i) _const_;
|
||||
OOMPolicy oom_policy_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(oom_policy, OOMPolicy);
|
||||
|
||||
/* Macros which append UNIT= or USER_UNIT= to the message */
|
||||
|
||||
@@ -1168,8 +1166,7 @@ OOMPolicy oom_policy_from_string(const char *s) _pure_;
|
||||
#define LOG_UNIT_ID(unit) LOG_ITEM("%s%s", unit_log_field((unit)), (unit)->id)
|
||||
#define LOG_UNIT_INVOCATION_ID(unit) LOG_ITEM("%s%s", unit_invocation_log_field((unit)), (unit)->invocation_id_string)
|
||||
|
||||
const char* collect_mode_to_string(CollectMode m) _const_;
|
||||
CollectMode collect_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(collect_mode, CollectMode);
|
||||
|
||||
typedef struct UnitForEachDependencyData {
|
||||
/* Stores state for the FOREACH macro below for iterating through all deps that have any of the
|
||||
|
||||
@@ -30,8 +30,5 @@ typedef enum WipeScope {
|
||||
_WIPE_SCOPE_INVALID = -EINVAL,
|
||||
} WipeScope;
|
||||
|
||||
const char* enroll_type_to_string(EnrollType t);
|
||||
EnrollType enroll_type_from_string(const char *s);
|
||||
|
||||
const char* luks2_token_type_to_string(EnrollType t);
|
||||
EnrollType luks2_token_type_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP(enroll_type, EnrollType);
|
||||
DECLARE_STRING_TABLE_LOOKUP(luks2_token_type, EnrollType);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "macro-fundamental.h"
|
||||
|
||||
#define DECLARE_STRING_TABLE_LOOKUP_TO_STRING(name, type) \
|
||||
const char* name##_to_string(type i) _const_
|
||||
|
||||
#define DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(name, type) \
|
||||
type name##_from_string(const char *s) _pure_
|
||||
|
||||
#define DECLARE_STRING_TABLE_LOOKUP(name, type) \
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(name, type); \
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(name, type)
|
||||
|
||||
#define DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type) \
|
||||
int name##_to_string_alloc(type i, char **ret)
|
||||
|
||||
#define DECLARE_STRING_TABLE_LOOKUP_WITH_FALLBACK(name, type) \
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type); \
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(name, type)
|
||||
@@ -230,5 +230,4 @@ bool home_shall_rebalance(Home *h);
|
||||
|
||||
bool home_is_busy(Home *h);
|
||||
|
||||
const char* home_state_to_string(HomeState state);
|
||||
HomeState home_state_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP(home_state, HomeState);
|
||||
|
||||
@@ -51,5 +51,4 @@ int import_compress_init(ImportCompress *c, ImportCompressType t);
|
||||
int import_compress(ImportCompress *c, const void *data, size_t size, void **buffer, size_t *buffer_size, size_t *buffer_allocated);
|
||||
int import_compress_finish(ImportCompress *c, void **buffer, size_t *buffer_size, size_t *buffer_allocated);
|
||||
|
||||
const char* import_compress_type_to_string(ImportCompressType t) _const_;
|
||||
ImportCompressType import_compress_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(import_compress_type, ImportCompressType);
|
||||
|
||||
@@ -99,11 +99,9 @@ int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_sig
|
||||
/* Defined in generated journald-gperf.c */
|
||||
const struct ConfigPerfItem* journald_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
|
||||
|
||||
const char* storage_to_string(Storage s) _const_;
|
||||
Storage storage_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(storage, Storage);
|
||||
|
||||
const char* split_mode_to_string(SplitMode s) _const_;
|
||||
SplitMode split_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(split_mode, SplitMode);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_storage);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_line_max);
|
||||
|
||||
@@ -20,7 +20,7 @@ typedef enum DHCPState {
|
||||
_DHCP_STATE_INVALID = -EINVAL,
|
||||
} DHCPState;
|
||||
|
||||
const char* dhcp_state_to_string(DHCPState s) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(dhcp_state, DHCPState);
|
||||
|
||||
typedef struct sd_dhcp_client sd_dhcp_client;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ static inline bool duid_data_size_is_valid(size_t size) {
|
||||
return size >= MIN_DUID_DATA_LEN && size <= MAX_DUID_DATA_LEN;
|
||||
}
|
||||
|
||||
const char* duid_type_to_string(DUIDType t) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(duid_type, DUIDType);
|
||||
int dhcp_duid_to_string_internal(uint16_t type, const void *data, size_t data_size, char **ret);
|
||||
|
||||
int dhcp_identifier_set_iaid(
|
||||
|
||||
@@ -150,9 +150,7 @@ typedef enum DHCP6FQDNFlag {
|
||||
DHCP6_FQDN_FLAG_N = 1 << 2,
|
||||
} DHCP6FQDNFlag;
|
||||
|
||||
const char* dhcp6_state_to_string(DHCP6State s) _const_;
|
||||
const char* dhcp6_message_type_to_string(DHCP6MessageType s) _const_;
|
||||
DHCP6MessageType dhcp6_message_type_from_string(const char *s) _pure_;
|
||||
const char* dhcp6_message_status_to_string(DHCP6Status s) _const_;
|
||||
DHCP6Status dhcp6_message_status_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(dhcp6_state, DHCP6State);
|
||||
DECLARE_STRING_TABLE_LOOKUP(dhcp6_message_type, DHCP6MessageType);
|
||||
DECLARE_STRING_TABLE_LOOKUP(dhcp6_message_status, DHCP6Status);
|
||||
int dhcp6_message_status_to_errno(DHCP6Status s);
|
||||
|
||||
@@ -33,8 +33,7 @@ struct sd_lldp_rx {
|
||||
struct ether_addr filter_address;
|
||||
};
|
||||
|
||||
const char* lldp_rx_event_to_string(sd_lldp_rx_event_t e) _const_;
|
||||
sd_lldp_rx_event_t lldp_rx_event_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(lldp_rx_event, sd_lldp_rx_event_t);
|
||||
|
||||
int lldp_rx_build_neighbors_json(sd_lldp_rx *lldp_rx, sd_json_variant **ret);
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ typedef struct sd_ndisc {
|
||||
void *userdata;
|
||||
} sd_ndisc;
|
||||
|
||||
const char* ndisc_event_to_string(sd_ndisc_event_t e) _const_;
|
||||
sd_ndisc_event_t ndisc_event_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(ndisc_event, sd_ndisc_event_t);
|
||||
|
||||
#define log_ndisc_errno(ndisc, error, fmt, ...) \
|
||||
log_interface_prefix_full_errno( \
|
||||
|
||||
@@ -34,4 +34,4 @@ sd_ndisc_router* ndisc_router_new(ICMP6Packet *packet);
|
||||
int ndisc_router_parse(sd_ndisc *nd, sd_ndisc_router *rt);
|
||||
|
||||
int ndisc_router_flags_to_string(uint64_t flags, char **ret);
|
||||
const char* ndisc_router_preference_to_string(int s) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(ndisc_router_preference, int);
|
||||
|
||||
@@ -72,5 +72,4 @@ static inline int device_read_db(sd_device *device) {
|
||||
int device_read_uevent_file(sd_device *device);
|
||||
|
||||
int device_set_action(sd_device *device, sd_device_action_t a);
|
||||
sd_device_action_t device_action_from_string(const char *s) _pure_;
|
||||
const char* device_action_to_string(sd_device_action_t a) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(device_action, sd_device_action_t);
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "sd-forward.h"
|
||||
|
||||
const char* audit_type_to_string(int type);
|
||||
int audit_type_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP(audit_type, int);
|
||||
|
||||
/* This is inspired by DNS TYPEnnn formatting */
|
||||
#define audit_type_name_alloca(type) \
|
||||
|
||||
@@ -335,7 +335,7 @@ uint64_t journal_file_hash_data(JournalFile *f, const void *data, size_t sz);
|
||||
|
||||
bool journal_field_valid(const char *p, size_t l, bool allow_protected);
|
||||
|
||||
const char* journal_object_type_to_string(ObjectType type) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(journal_object_type, ObjectType);
|
||||
|
||||
static inline Compression COMPRESSION_FROM_OBJECT(const Object *o) {
|
||||
assert(o);
|
||||
|
||||
@@ -73,20 +73,15 @@ typedef enum LinkOnlineState {
|
||||
_LINK_ONLINE_STATE_INVALID = -EINVAL,
|
||||
} LinkOnlineState;
|
||||
|
||||
const char* link_operstate_to_string(LinkOperationalState s) _const_;
|
||||
LinkOperationalState link_operstate_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(link_operstate, LinkOperationalState);
|
||||
|
||||
const char* link_carrier_state_to_string(LinkCarrierState s) _const_;
|
||||
LinkCarrierState link_carrier_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(link_carrier_state, LinkCarrierState);
|
||||
|
||||
const char* link_required_address_family_to_string(AddressFamily s) _const_;
|
||||
AddressFamily link_required_address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(link_required_address_family, AddressFamily);
|
||||
|
||||
const char* link_address_state_to_string(LinkAddressState s) _const_;
|
||||
LinkAddressState link_address_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(link_address_state, LinkAddressState);
|
||||
|
||||
const char* link_online_state_to_string(LinkOnlineState s) _const_;
|
||||
LinkOnlineState link_online_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(link_online_state, LinkOnlineState);
|
||||
|
||||
typedef struct LinkOperationalStateRange {
|
||||
LinkOperationalState min;
|
||||
|
||||
@@ -77,10 +77,8 @@ int manager_handle_action(
|
||||
bool is_edge,
|
||||
const char *action_seat);
|
||||
|
||||
const char* handle_action_verb_to_string(HandleAction h) _const_;
|
||||
|
||||
const char* handle_action_to_string(HandleAction h) _const_;
|
||||
HandleAction handle_action_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(handle_action_verb, HandleAction);
|
||||
DECLARE_STRING_TABLE_LOOKUP(handle_action, HandleAction);
|
||||
|
||||
const HandleActionData* handle_action_lookup(HandleAction action);
|
||||
|
||||
|
||||
@@ -87,5 +87,4 @@ static inline bool inhibit_what_is_valid(InhibitWhat w) {
|
||||
const char* inhibit_what_to_string(InhibitWhat w);
|
||||
int inhibit_what_from_string(const char *s);
|
||||
|
||||
const char* inhibit_mode_to_string(InhibitMode k);
|
||||
InhibitMode inhibit_mode_from_string(const char *s);
|
||||
DECLARE_STRING_TABLE_LOOKUP(inhibit_mode, InhibitMode);
|
||||
|
||||
@@ -196,20 +196,15 @@ int session_kill(Session *s, KillWhom whom, int signo, sd_bus_error *error);
|
||||
|
||||
SessionState session_get_state(Session *s);
|
||||
|
||||
const char* session_state_to_string(SessionState t) _const_;
|
||||
SessionState session_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(session_state, SessionState);
|
||||
|
||||
const char* session_type_to_string(SessionType t) _const_;
|
||||
SessionType session_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(session_type, SessionType);
|
||||
|
||||
const char* session_class_to_string(SessionClass t) _const_;
|
||||
SessionClass session_class_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(session_class, SessionClass);
|
||||
|
||||
const char* kill_whom_to_string(KillWhom k) _const_;
|
||||
KillWhom kill_whom_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(kill_whom, KillWhom);
|
||||
|
||||
const char* tty_validity_to_string(TTYValidity t) _const_;
|
||||
TTYValidity tty_validity_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(tty_validity, TTYValidity);
|
||||
|
||||
void session_leave_vt(Session *s);
|
||||
|
||||
|
||||
@@ -83,10 +83,8 @@ int user_check_linger_file(const User *u);
|
||||
void user_elect_display(User *u);
|
||||
void user_update_last_session_timer(User *u);
|
||||
|
||||
const char* user_state_to_string(UserState s) _const_;
|
||||
UserState user_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(user_state, UserState);
|
||||
|
||||
const char* user_gc_mode_to_string(UserGCMode m) _const_;
|
||||
UserGCMode user_gc_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(user_gc_mode, UserGCMode);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_compat_user_tasks_max);
|
||||
|
||||
+1
-2
@@ -10,8 +10,7 @@ typedef enum ImageCleanPoolMode {
|
||||
_IMAGE_CLEAN_POOL_INVALID = -EINVAL,
|
||||
} ImageCleanPoolMode;
|
||||
|
||||
ImageCleanPoolMode image_clean_pool_mode_from_string(const char *s) _pure_;
|
||||
const char* image_clean_pool_mode_to_string(ImageCleanPoolMode mode) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(image_clean_pool_mode, ImageCleanPoolMode);
|
||||
|
||||
int image_clean_pool_operation(Manager *manager, ImageCleanPoolMode mode, Operation **ret_operation);
|
||||
int clean_pool_read_first_entry(FILE *file, int child_error, sd_bus_error *error);
|
||||
|
||||
@@ -107,14 +107,11 @@ void machine_release_unit(Machine *m);
|
||||
|
||||
MachineState machine_get_state(Machine *m);
|
||||
|
||||
const char* machine_class_to_string(MachineClass t) _const_;
|
||||
MachineClass machine_class_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(machine_class, MachineClass);
|
||||
|
||||
const char* machine_state_to_string(MachineState t) _const_;
|
||||
MachineState machine_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(machine_state, MachineState);
|
||||
|
||||
const char* kill_whom_to_string(KillWhom k) _const_;
|
||||
KillWhom kill_whom_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(kill_whom, KillWhom);
|
||||
|
||||
int machine_openpt(Machine *m, int flags, char **ret_peer);
|
||||
int machine_start_getty(Machine *m, const char *ptmx_name, sd_bus_error *error);
|
||||
@@ -149,8 +146,7 @@ typedef enum AcquireMetadata {
|
||||
_ACQUIRE_METADATA_INVALID = -EINVAL,
|
||||
} AcquireMetadata;
|
||||
|
||||
AcquireMetadata acquire_metadata_from_string(const char *s) _pure_;
|
||||
const char* acquire_metadata_to_string(AcquireMetadata am) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(acquire_metadata, AcquireMetadata);
|
||||
inline static bool should_acquire_metadata(AcquireMetadata am) {
|
||||
return am == ACQUIRE_METADATA_YES || am == ACQUIRE_METADATA_GRACEFUL;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Copyright © 2020 VMware, Inc. */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "netdev.h"
|
||||
#include "shared-forward.h"
|
||||
|
||||
typedef enum BareUDPProtocol {
|
||||
BARE_UDP_PROTOCOL_IPV4 = ETH_P_IP,
|
||||
@@ -25,7 +25,6 @@ typedef struct BareUDP {
|
||||
DEFINE_NETDEV_CAST(BAREUDP, BareUDP);
|
||||
extern const NetDevVTable bare_udp_vtable;
|
||||
|
||||
const char* bare_udp_protocol_to_string(BareUDPProtocol d) _const_;
|
||||
BareUDPProtocol bare_udp_protocol_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bare_udp_protocol, BareUDPProtocol);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "netdev.h"
|
||||
#include "shared-forward.h"
|
||||
|
||||
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128U
|
||||
#define LINK_BRIDGE_PORT_PRIORITY_MAX 63U
|
||||
@@ -41,8 +41,7 @@ typedef enum MulticastRouter {
|
||||
DEFINE_NETDEV_CAST(BRIDGE, Bridge);
|
||||
extern const NetDevVTable bridge_vtable;
|
||||
|
||||
const char* multicast_router_to_string(MulticastRouter i) _const_;
|
||||
MulticastRouter multicast_router_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(multicast_router, MulticastRouter);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_multicast_router);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_bridge_igmp_version);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include <linux/fou.h>
|
||||
|
||||
#include "in-addr-util.h"
|
||||
#include "shared-forward.h"
|
||||
#include "netdev.h"
|
||||
#include "shared-forward.h"
|
||||
|
||||
typedef enum FooOverUDPEncapType {
|
||||
NETDEV_FOO_OVER_UDP_ENCAP_UNSPEC = FOU_ENCAP_UNSPEC,
|
||||
@@ -34,8 +34,7 @@ typedef struct FouTunnel {
|
||||
DEFINE_NETDEV_CAST(FOU, FouTunnel);
|
||||
extern const NetDevVTable foutnl_vtable;
|
||||
|
||||
const char* fou_encap_type_to_string(FooOverUDPEncapType d) _const_;
|
||||
FooOverUDPEncapType fou_encap_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(fou_encap_type, FooOverUDPEncapType);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_fou_tunnel_address);
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include <linux/if_link.h>
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "netdev.h"
|
||||
#include "shared-forward.h"
|
||||
|
||||
#define GENEVE_VID_MAX (1u << 24) - 1
|
||||
|
||||
@@ -44,8 +44,7 @@ typedef struct Geneve {
|
||||
DEFINE_NETDEV_CAST(GENEVE, Geneve);
|
||||
extern const NetDevVTable geneve_vtable;
|
||||
|
||||
const char* geneve_df_to_string(GeneveDF d) _const_;
|
||||
GeneveDF geneve_df_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(geneve_df, GeneveDF);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_geneve_vni);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_geneve_address);
|
||||
|
||||
@@ -23,6 +23,6 @@ typedef struct Hsr {
|
||||
DEFINE_NETDEV_CAST(HSR, Hsr);
|
||||
extern const NetDevVTable hsr_vtable;
|
||||
|
||||
HsrProtocol hsr_protocol_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(hsr_protocol, HsrProtocol);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_hsr_protocol);
|
||||
|
||||
@@ -14,8 +14,7 @@ typedef enum NetDevLocalAddressType {
|
||||
_NETDEV_LOCAL_ADDRESS_TYPE_INVALID = -EINVAL,
|
||||
} NetDevLocalAddressType;
|
||||
|
||||
const char* netdev_local_address_type_to_string(NetDevLocalAddressType t) _const_;
|
||||
NetDevLocalAddressType netdev_local_address_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(netdev_local_address_type, NetDevLocalAddressType);
|
||||
|
||||
int link_get_local_address(
|
||||
Link *link,
|
||||
|
||||
@@ -241,8 +241,7 @@ int netdev_generate_hw_addr(NetDev *netdev, Link *parent, const char *name,
|
||||
bool netdev_needs_reconfigure(NetDev *netdev, NetDevLocalAddressType type);
|
||||
int link_request_stacked_netdev(Link *link, NetDev *netdev);
|
||||
|
||||
const char* netdev_kind_to_string(NetDevKind d) _const_;
|
||||
NetDevKind netdev_kind_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(netdev_kind, NetDevKind);
|
||||
|
||||
static inline NetDevCreateType netdev_get_create_type(NetDev *netdev) {
|
||||
assert(netdev);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "fou-tunnel.h"
|
||||
#include "netdev.h"
|
||||
#include "networkd-link.h"
|
||||
#include "shared-forward.h"
|
||||
|
||||
/* For IFLA_IPTUN_PROTO attribute */
|
||||
typedef enum TunnelMode {
|
||||
@@ -122,8 +122,7 @@ extern const NetDevVTable ip6gretap_vtable;
|
||||
extern const NetDevVTable ip6tnl_vtable;
|
||||
extern const NetDevVTable erspan_vtable;
|
||||
|
||||
const char* tunnel_mode_to_string(TunnelMode d) _const_;
|
||||
TunnelMode tunnel_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(tunnel_mode, TunnelMode);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_mode);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_local_address);
|
||||
|
||||
@@ -65,8 +65,7 @@ typedef struct VxLan {
|
||||
DEFINE_NETDEV_CAST(VXLAN, VxLan);
|
||||
extern const NetDevVTable vxlan_vtable;
|
||||
|
||||
const char* df_to_string(VxLanDF d) _const_;
|
||||
VxLanDF df_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(df, VxLanDF);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_port_range);
|
||||
|
||||
@@ -73,8 +73,7 @@ static inline bool in6_prefix_is_filtered(const struct in6_addr *prefix, uint8_t
|
||||
|
||||
int link_get_captive_portal(Link *link, const char **ret);
|
||||
|
||||
const char* dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_;
|
||||
DHCPOptionDataType dhcp_option_data_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dhcp_option_data_type, DHCPOptionDataType);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_route_metric);
|
||||
|
||||
@@ -26,5 +26,4 @@ CONFIG_PARSER_PROTOTYPE(config_parse_dhcp6_pd_prefix_hint);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp6_mud_url);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp6_client_start_mode);
|
||||
|
||||
const char* dhcp6_client_start_mode_to_string(DHCP6ClientStartMode i) _const_;
|
||||
DHCP6ClientStartMode dhcp6_client_start_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dhcp6_client_start_mode, DHCP6ClientStartMode);
|
||||
|
||||
@@ -16,8 +16,7 @@ UseDomains link_get_use_domains(Link *link, NetworkConfigSource proto);
|
||||
bool link_get_use_dns(Link *link, NetworkConfigSource proto);
|
||||
bool link_get_use_dnr(Link *link, NetworkConfigSource proto);
|
||||
|
||||
const char* use_domains_to_string(UseDomains p) _const_;
|
||||
UseDomains use_domains_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(use_domains, UseDomains);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_domains);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dns);
|
||||
|
||||
@@ -24,7 +24,6 @@ int link_update_ipv6ll_addrgen_mode(Link *link, sd_netlink_message *message);
|
||||
int link_set_ipv6ll_stable_secret(Link *link);
|
||||
int link_set_ipv6ll_addrgen_mode(Link *link, IPv6LinkLocalAddressGenMode mode);
|
||||
|
||||
const char* ipv6_link_local_address_gen_mode_to_string(IPv6LinkLocalAddressGenMode s) _const_;
|
||||
IPv6LinkLocalAddressGenMode ipv6_link_local_address_gen_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(ipv6_link_local_address_gen_mode, IPv6LinkLocalAddressGenMode);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_link_local_address_gen_mode);
|
||||
|
||||
@@ -235,8 +235,7 @@ bool link_has_ipv6_connectivity(Link *link);
|
||||
|
||||
int link_stop_engines(Link *link, bool may_keep_dynamic);
|
||||
|
||||
const char* link_state_to_string(LinkState s) _const_;
|
||||
LinkState link_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(link_state, LinkState);
|
||||
|
||||
int link_request_stacked_netdevs(Link *link, NetDevLocalAddressType type);
|
||||
|
||||
@@ -251,8 +250,8 @@ int link_check_initialized(Link *link);
|
||||
int manager_udev_process_link(Manager *m, sd_device *device, sd_device_action_t action);
|
||||
int manager_rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
|
||||
|
||||
int link_flags_to_string_alloc(uint32_t flags, char **ret);
|
||||
const char* kernel_operstate_to_string(int t) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(link_flags, uint32_t);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(kernel_operstate, int);
|
||||
|
||||
void link_required_operstate_for_online(Link *link, LinkOperationalStateRange *ret);
|
||||
AddressFamily link_required_family_for_online(Link *link);
|
||||
|
||||
@@ -13,7 +13,6 @@ typedef enum LLDPMode {
|
||||
|
||||
int link_lldp_rx_configure(Link *link);
|
||||
|
||||
const char* lldp_mode_to_string(LLDPMode m) _const_;
|
||||
LLDPMode lldp_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(lldp_mode, LLDPMode);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_lldp_mode);
|
||||
|
||||
@@ -442,8 +442,6 @@ CONFIG_PARSER_PROTOTYPE(config_parse_ignore_carrier_loss);
|
||||
|
||||
const struct ConfigPerfItem* network_network_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
|
||||
|
||||
const char* keep_configuration_to_string(KeepConfiguration i) _const_;
|
||||
KeepConfiguration keep_configuration_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(keep_configuration, KeepConfiguration);
|
||||
|
||||
const char* activation_policy_to_string(ActivationPolicy i) _const_;
|
||||
ActivationPolicy activation_policy_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(activation_policy, ActivationPolicy);
|
||||
|
||||
@@ -150,7 +150,7 @@ static inline int link_queue_request(
|
||||
int manager_process_requests(Manager *manager);
|
||||
int request_call_netlink_async(sd_netlink *nl, sd_netlink_message *m, Request *req);
|
||||
|
||||
const char* request_type_to_string(RequestType t) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(request_type, RequestType);
|
||||
|
||||
typedef struct RemoveRequest RemoveRequest;
|
||||
typedef int (*remove_request_netlink_handler_t)(sd_netlink *nl, sd_netlink_message *m, RemoveRequest *req);
|
||||
|
||||
@@ -56,8 +56,7 @@ int radv_add_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_le
|
||||
int link_request_radv(Link *link);
|
||||
int link_drop_radv_config(Link *link, Network *network);
|
||||
|
||||
const char* radv_prefix_delegation_to_string(RADVPrefixDelegation i) _const_;
|
||||
RADVPrefixDelegation radv_prefix_delegation_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(radv_prefix_delegation, RADVPrefixDelegation);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_router_prefix_delegation);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_router_lifetime);
|
||||
|
||||
@@ -31,18 +31,17 @@ int manager_address_is_reachable(
|
||||
const union in_addr_union *prefsrc, /* optional */
|
||||
Address **ret);
|
||||
|
||||
int route_type_from_string(const char *s) _pure_;
|
||||
const char* route_type_to_string(int t) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(route_type, int);
|
||||
|
||||
int route_scope_from_string(const char *s);
|
||||
int route_scope_to_string_alloc(int t, char **ret);
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(route_scope, int);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_scope, int);
|
||||
|
||||
int route_protocol_from_string(const char *s);
|
||||
int route_protocol_to_string_alloc(int t, char **ret);
|
||||
int route_protocol_full_from_string(const char *s);
|
||||
int route_protocol_full_to_string_alloc(int t, char **ret);
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(route_protocol, int);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_protocol, int);
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(route_protocol_full, int);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_protocol_full, int);
|
||||
|
||||
int route_flags_to_string_alloc(uint32_t flags, char **ret);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(route_flags, uint32_t);
|
||||
|
||||
int manager_get_route_table_from_string(const Manager *m, const char *s, uint32_t *ret);
|
||||
int manager_get_route_table_to_string(const Manager *m, uint32_t table, bool append_num, char **ret);
|
||||
|
||||
@@ -46,8 +46,7 @@ typedef struct RoutingPolicyRule {
|
||||
struct fib_rule_port_range dport; /* FRA_DPORT_RANGE */
|
||||
} RoutingPolicyRule;
|
||||
|
||||
int fr_act_type_from_string(const char *s) _pure_;
|
||||
const char* fr_act_type_to_string(int t) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(fr_act_type, int);
|
||||
|
||||
DECLARE_TRIVIAL_REF_UNREF_FUNC(RoutingPolicyRule, routing_policy_rule);
|
||||
|
||||
|
||||
@@ -39,11 +39,9 @@ int link_set_sysctl(Link *link);
|
||||
int link_set_ipv6_mtu(Link *link, int log_level);
|
||||
int link_set_ipv6_mtu_async(Link *link);
|
||||
|
||||
const char* ipv6_privacy_extensions_to_string(IPv6PrivacyExtensions i) _const_;
|
||||
IPv6PrivacyExtensions ipv6_privacy_extensions_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(ipv6_privacy_extensions, IPv6PrivacyExtensions);
|
||||
|
||||
const char* ip_reverse_path_filter_to_string(IPReversePathFilter i) _const_;
|
||||
IPReversePathFilter ip_reverse_path_filter_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(ip_reverse_path_filter, IPReversePathFilter);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_privacy_extensions);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ip_reverse_path_filter);
|
||||
@@ -59,7 +57,6 @@ typedef enum IPv4ForceIgmpVersion {
|
||||
_IPV4_FORCE_IGMP_VERSION_INVALID = -EINVAL,
|
||||
} IPv4ForceIgmpVersion;
|
||||
|
||||
const char* ipv4_force_igmp_version_to_string(IPv4ForceIgmpVersion i) _const_;
|
||||
IPv4ForceIgmpVersion ipv4_force_igmp_version_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(ipv4_force_igmp_version, IPv4ForceIgmpVersion);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipv4_force_igmp_version);
|
||||
|
||||
@@ -47,10 +47,9 @@ CONFIG_PARSER_PROTOTYPE(config_parse_link_local_address_family);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ip_masquerade);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_mud_url);
|
||||
|
||||
const char* network_config_source_to_string(NetworkConfigSource s) _const_;
|
||||
NetworkConfigSource network_config_source_from_string(const char* s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(network_config_source, NetworkConfigSource);
|
||||
|
||||
int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(network_config_state, NetworkConfigState);
|
||||
|
||||
#define DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(type, name) \
|
||||
static inline void name##_update_state( \
|
||||
@@ -124,24 +123,19 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
|
||||
0); \
|
||||
}
|
||||
|
||||
const char* address_family_to_string(AddressFamily b) _const_;
|
||||
AddressFamily address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(address_family, AddressFamily);
|
||||
|
||||
AddressFamily link_local_address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(link_local_address_family, AddressFamily);
|
||||
|
||||
const char* routing_policy_rule_address_family_to_string(AddressFamily b) _const_;
|
||||
AddressFamily routing_policy_rule_address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(routing_policy_rule_address_family, AddressFamily);
|
||||
|
||||
const char* nexthop_address_family_to_string(AddressFamily b) _const_;
|
||||
AddressFamily nexthop_address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(nexthop_address_family, AddressFamily);
|
||||
|
||||
const char* duplicate_address_detection_address_family_to_string(AddressFamily b) _const_;
|
||||
AddressFamily duplicate_address_detection_address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(duplicate_address_detection_address_family, AddressFamily);
|
||||
|
||||
AddressFamily dhcp_deprecated_address_family_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(dhcp_deprecated_address_family, AddressFamily);
|
||||
|
||||
const char* dhcp_lease_server_type_to_string(sd_dhcp_lease_server_type_t t) _const_;
|
||||
sd_dhcp_lease_server_type_t dhcp_lease_server_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dhcp_lease_server_type, sd_dhcp_lease_server_type_t);
|
||||
|
||||
bool link_should_mark_config(Link *link, bool only_static, NetworkConfigSource source, uint8_t protocol);
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include "capability-util.h"
|
||||
#include "conf-parser-forward.h"
|
||||
#include "cpu-set-util.h"
|
||||
#include "shared-forward.h"
|
||||
#include "rlimit-util.h"
|
||||
#include "seccomp-util.h"
|
||||
#include "shared-forward.h"
|
||||
#include "volatile-util.h"
|
||||
|
||||
typedef struct CustomMount CustomMount;
|
||||
@@ -277,17 +277,13 @@ CONFIG_PARSER_PROTOTYPE(config_parse_userns_ownership);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_bind_user);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_bind_user_shell);
|
||||
|
||||
const char* resolv_conf_mode_to_string(ResolvConfMode a) _const_;
|
||||
ResolvConfMode resolv_conf_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(resolv_conf_mode, ResolvConfMode);
|
||||
|
||||
const char* timezone_mode_to_string(TimezoneMode a) _const_;
|
||||
TimezoneMode timezone_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(timezone_mode, TimezoneMode);
|
||||
|
||||
const char* console_mode_to_string(ConsoleMode m) _const_;
|
||||
ConsoleMode console_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(console_mode, ConsoleMode);
|
||||
|
||||
const char* user_namespace_ownership_to_string(UserNamespaceOwnership a) _const_;
|
||||
UserNamespaceOwnership user_namespace_ownership_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(user_namespace_ownership, UserNamespaceOwnership);
|
||||
|
||||
int parse_link_journal(const char *s, LinkJournal *ret_mode, bool *ret_try);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "shared-forward.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "shared-forward.h"
|
||||
#include "string-util.h"
|
||||
|
||||
typedef struct PortableMetadata {
|
||||
@@ -114,8 +114,6 @@ int portable_get_profiles(char ***ret);
|
||||
|
||||
void portable_changes_free(PortableChange *changes, size_t n_changes);
|
||||
|
||||
const char* portable_change_type_to_string(int t) _const_;
|
||||
int portable_change_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(portable_change_type, int);
|
||||
|
||||
const char* portable_state_to_string(PortableState t) _const_;
|
||||
PortableState portable_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(portable_state, PortableState);
|
||||
|
||||
@@ -75,8 +75,6 @@ int dnssec_nsec_test(DnsAnswer *answer, DnsResourceKey *key, DnssecNsecResult *r
|
||||
|
||||
int dnssec_test_positive_wildcard(DnsAnswer *a, const char *name, const char *source, const char *zone, bool *authenticated);
|
||||
|
||||
const char* dnssec_result_to_string(DnssecResult m) _const_;
|
||||
DnssecResult dnssec_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dnssec_result, DnssecResult);
|
||||
|
||||
const char* dnssec_verdict_to_string(DnssecVerdict m) _const_;
|
||||
DnssecVerdict dnssec_verdict_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dnssec_verdict, DnssecVerdict);
|
||||
|
||||
@@ -125,5 +125,4 @@ int dns_scope_to_json(DnsScope *scope, bool with_cache, sd_json_variant **ret);
|
||||
int dns_type_suitable_for_protocol(uint16_t type, DnsProtocol protocol);
|
||||
int dns_question_types_suitable_for_protocol(DnsQuestion *q, DnsProtocol protocol);
|
||||
|
||||
const char* dns_scope_origin_to_string(DnsScopeOrigin origin) _const_;
|
||||
DnsScopeOrigin dns_scope_origin_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dns_scope_origin, DnsScopeOrigin);
|
||||
|
||||
@@ -16,8 +16,7 @@ typedef enum DnsServerType {
|
||||
_DNS_SERVER_TYPE_INVALID = -EINVAL,
|
||||
} DnsServerType;
|
||||
|
||||
const char* dns_server_type_to_string(DnsServerType i) _const_;
|
||||
DnsServerType dns_server_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dns_server_type, DnsServerType);
|
||||
|
||||
typedef enum DnsServerFeatureLevel {
|
||||
DNS_SERVER_FEATURE_LEVEL_TCP,
|
||||
@@ -37,8 +36,7 @@ typedef enum DnsServerFeatureLevel {
|
||||
#define DNS_SERVER_FEATURE_LEVEL_IS_DNSSEC(x) ((x) >= DNS_SERVER_FEATURE_LEVEL_DO)
|
||||
#define DNS_SERVER_FEATURE_LEVEL_IS_UDP(x) IN_SET(x, DNS_SERVER_FEATURE_LEVEL_UDP, DNS_SERVER_FEATURE_LEVEL_EDNS0, DNS_SERVER_FEATURE_LEVEL_DO)
|
||||
|
||||
const char* dns_server_feature_level_to_string(DnsServerFeatureLevel i) _const_;
|
||||
DnsServerFeatureLevel dns_server_feature_level_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dns_server_feature_level, DnsServerFeatureLevel);
|
||||
|
||||
typedef struct DnsServer {
|
||||
Manager *manager;
|
||||
|
||||
@@ -41,5 +41,4 @@ static inline uint16_t dns_stub_listener_extra_port(DnsStubListenerExtra *p) {
|
||||
void manager_dns_stub_stop(Manager *m);
|
||||
int manager_dns_stub_start(Manager *m);
|
||||
|
||||
const char* dns_stub_listener_mode_to_string(DnsStubListenerMode p) _const_;
|
||||
DnsStubListenerMode dns_stub_listener_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dns_stub_listener_mode, DnsStubListenerMode);
|
||||
|
||||
@@ -178,8 +178,6 @@ static inline uint64_t dns_transaction_source_to_query_flags(DnsTransactionSourc
|
||||
}
|
||||
}
|
||||
|
||||
const char* dns_transaction_state_to_string(DnsTransactionState p) _const_;
|
||||
DnsTransactionState dns_transaction_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dns_transaction_state, DnsTransactionState);
|
||||
|
||||
const char* dns_transaction_source_to_string(DnsTransactionSource p) _const_;
|
||||
DnsTransactionSource dns_transaction_source_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(dns_transaction_source, DnsTransactionSource);
|
||||
|
||||
@@ -19,5 +19,4 @@ typedef enum ResolvConfMode {
|
||||
|
||||
int resolv_conf_mode(void);
|
||||
|
||||
const char* resolv_conf_mode_to_string(ResolvConfMode m) _const_;
|
||||
ResolvConfMode resolv_conf_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(resolv_conf_mode, ResolvConfMode);
|
||||
|
||||
+8
-16
@@ -80,26 +80,18 @@ typedef enum BondPrimaryReselect {
|
||||
_NETDEV_BOND_PRIMARY_RESELECT_INVALID = -EINVAL,
|
||||
} BondPrimaryReselect;
|
||||
|
||||
const char* bond_mode_to_string(BondMode d) _const_;
|
||||
BondMode bond_mode_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_mode, BondMode);
|
||||
|
||||
const char* bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_;
|
||||
BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_xmit_hash_policy, BondXmitHashPolicy);
|
||||
|
||||
const char* bond_lacp_rate_to_string(BondLacpRate d) _const_;
|
||||
BondLacpRate bond_lacp_rate_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_lacp_rate, BondLacpRate);
|
||||
|
||||
const char* bond_fail_over_mac_to_string(BondFailOverMac d) _const_;
|
||||
BondFailOverMac bond_fail_over_mac_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_fail_over_mac, BondFailOverMac);
|
||||
|
||||
const char* bond_ad_select_to_string(BondAdSelect d) _const_;
|
||||
BondAdSelect bond_ad_select_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_ad_select, BondAdSelect);
|
||||
|
||||
const char* bond_arp_validate_to_string(BondArpValidate d) _const_;
|
||||
BondArpValidate bond_arp_validate_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_arp_validate, BondArpValidate);
|
||||
|
||||
const char* bond_arp_all_targets_to_string(BondArpAllTargets d) _const_;
|
||||
BondArpAllTargets bond_arp_all_targets_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_arp_all_targets, BondArpAllTargets);
|
||||
|
||||
const char* bond_primary_reselect_to_string(BondPrimaryReselect d) _const_;
|
||||
BondPrimaryReselect bond_primary_reselect_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bond_primary_reselect, BondPrimaryReselect);
|
||||
|
||||
@@ -34,4 +34,4 @@ int boot_entry_token_ensure_at(
|
||||
|
||||
int parse_boot_entry_token_type(const char *s, BootEntryTokenType *type, char **token);
|
||||
|
||||
const char* boot_entry_token_type_to_string(BootEntryTokenType t);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_token_type, BootEntryTokenType);
|
||||
|
||||
@@ -96,12 +96,11 @@ typedef struct BootConfig {
|
||||
.selected_entry = -1, \
|
||||
}
|
||||
|
||||
const char* boot_entry_type_description_to_string(BootEntryType) _const_;
|
||||
const char* boot_entry_type_to_string(BootEntryType) _const_;
|
||||
BootEntryType boot_entry_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_type_description, BootEntryType);
|
||||
DECLARE_STRING_TABLE_LOOKUP(boot_entry_type, BootEntryType);
|
||||
|
||||
const char* boot_entry_source_description_to_string(BootEntrySource) _const_;
|
||||
const char* boot_entry_source_to_string(BootEntrySource) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source_description, BootEntrySource);
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source, BootEntrySource);
|
||||
|
||||
BootEntry* boot_config_find_entry(BootConfig *config, const char *id);
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ int bpf_map_new(const char *name, enum bpf_map_type type, size_t key_size, size_
|
||||
int bpf_map_update_element(int fd, const void *key, void *value);
|
||||
int bpf_map_lookup_element(int fd, const void *key, void *value);
|
||||
|
||||
int bpf_cgroup_attach_type_from_string(const char *str) _pure_;
|
||||
const char* bpf_cgroup_attach_type_to_string(int attach_type) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bpf_cgroup_attach_type, int);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(BPFProgram*, bpf_program_free);
|
||||
|
||||
@@ -15,5 +15,4 @@ typedef enum BridgeState {
|
||||
_NETDEV_BRIDGE_STATE_INVALID = -EINVAL,
|
||||
} BridgeState;
|
||||
|
||||
const char* bridge_state_to_string(BridgeState d) _const_;
|
||||
BridgeState bridge_state_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(bridge_state, BridgeState);
|
||||
|
||||
@@ -11,7 +11,7 @@ typedef enum ExecDirectoryFlags {
|
||||
_EXEC_DIRECTORY_FLAGS_INVALID = -EINVAL,
|
||||
} ExecDirectoryFlags;
|
||||
|
||||
ExecDirectoryFlags exec_directory_flags_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(exec_directory_flags, ExecDirectoryFlags);
|
||||
|
||||
typedef struct UnitInfo {
|
||||
const char *machine;
|
||||
|
||||
@@ -72,4 +72,4 @@ int bus_query_sender_pidref(sd_bus_message *m, PidRef *ret);
|
||||
|
||||
int bus_get_instance_id(sd_bus *bus, sd_id128_t *ret);
|
||||
|
||||
const char* bus_transport_to_string(BusTransport transport) _const_;
|
||||
DECLARE_STRING_TABLE_LOOKUP_TO_STRING(bus_transport, BusTransport);
|
||||
|
||||
@@ -87,16 +87,13 @@ bool condition_test_list(Condition *first, char **env, condition_to_string_t to_
|
||||
void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string);
|
||||
void condition_dump_list(Condition *first, FILE *f, const char *prefix, condition_to_string_t to_string);
|
||||
|
||||
const char* condition_type_to_string(ConditionType t) _const_;
|
||||
ConditionType condition_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(condition_type, ConditionType);
|
||||
void condition_types_list(void);
|
||||
|
||||
const char* assert_type_to_string(ConditionType t) _const_;
|
||||
ConditionType assert_type_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(assert_type, ConditionType);
|
||||
void assert_types_list(void);
|
||||
|
||||
const char* condition_result_to_string(ConditionResult r) _const_;
|
||||
ConditionResult condition_result_from_string(const char *s) _pure_;
|
||||
DECLARE_STRING_TABLE_LOOKUP(condition_result, ConditionResult);
|
||||
|
||||
static inline bool condition_takes_path(ConditionType t) {
|
||||
return IN_SET(t,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user