diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-13 13:42:42 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-13 14:04:29 +0100 |
commit | bc768f04754eee04a3468f333538985ce98ce495 (patch) | |
tree | 0bb7b014dfbf73354aa6c2aabaf8031c2f8ba833 | |
parent | 4b3ca79ea9e69fcf3e3d376e6342130aa4564b9b (diff) | |
download | systemd-bc768f04754eee04a3468f333538985ce98ce495.tar.gz systemd-bc768f04754eee04a3468f333538985ce98ce495.tar.bz2 systemd-bc768f04754eee04a3468f333538985ce98ce495.zip |
udev: move ResolveNameTiming definition and parsers to udev-util.h
Follow-up for c4d44cba4d9bd9d92c86e06f21d5936cca1b8c16. No functional change,
but the parser is moved to libsystemd-shared.so.
-rw-r--r-- | src/shared/udev-util.c | 9 | ||||
-rw-r--r-- | src/shared/udev-util.h | 11 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 9 | ||||
-rw-r--r-- | src/udev/udev.h | 12 |
4 files changed, 21 insertions, 20 deletions
diff --git a/src/shared/udev-util.c b/src/shared/udev-util.c index 057aabcd54..a85a33d3ae 100644 --- a/src/shared/udev-util.c +++ b/src/shared/udev-util.c @@ -7,10 +7,19 @@ #include "fileio.h" #include "log.h" #include "parse-util.h" +#include "string-table.h" #include "string-util.h" #include "udev-util.h" #include "udev.h" +static const char* const resolve_name_timing_table[_RESOLVE_NAME_TIMING_MAX] = { + [RESOLVE_NAME_NEVER] = "never", + [RESOLVE_NAME_LATE] = "late", + [RESOLVE_NAME_EARLY] = "early", +}; + +DEFINE_STRING_TABLE_LOOKUP(resolve_name_timing, ResolveNameTiming); + int udev_parse_config_full( unsigned *ret_children_max, usec_t *ret_exec_delay_usec, diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index efbcd82976..b1913daf86 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -3,6 +3,17 @@ #include "time-util.h" +typedef enum ResolveNameTiming { + RESOLVE_NAME_NEVER, + RESOLVE_NAME_LATE, + RESOLVE_NAME_EARLY, + _RESOLVE_NAME_TIMING_MAX, + _RESOLVE_NAME_TIMING_INVALID = -1, +} ResolveNameTiming; + +ResolveNameTiming resolve_name_timing_from_string(const char *s) _pure_; +const char *resolve_name_timing_to_string(ResolveNameTiming i) _const_; + int udev_parse_config_full( unsigned *ret_children_max, usec_t *ret_exec_delay_usec, diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index e96bc46d62..d582319cf7 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -30,7 +30,6 @@ #include "stat-util.h" #include "stdio-util.h" #include "strbuf.h" -#include "string-table.h" #include "string-util.h" #include "strv.h" #include "sysctl-util.h" @@ -2599,11 +2598,3 @@ finish: return 0; } - -static const char* const resolve_name_timing_table[_RESOLVE_NAME_TIMING_MAX] = { - [RESOLVE_NAME_NEVER] = "never", - [RESOLVE_NAME_LATE] = "late", - [RESOLVE_NAME_EARLY] = "early", -}; - -DEFINE_STRING_TABLE_LOOKUP(resolve_name_timing, ResolveNameTiming); diff --git a/src/udev/udev.h b/src/udev/udev.h index f61d90e71a..e92e878e24 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -18,6 +18,7 @@ #include "macro.h" #include "strv.h" #include "util.h" +#include "udev-util.h" struct udev_event { sd_device *dev; @@ -48,14 +49,6 @@ struct udev_event { bool run_final; }; -typedef enum ResolveNameTiming { - RESOLVE_NAME_NEVER, - RESOLVE_NAME_LATE, - RESOLVE_NAME_EARLY, - _RESOLVE_NAME_TIMING_MAX, - _RESOLVE_NAME_TIMING_INVALID = -1, -} ResolveNameTiming; - /* udev-rules.c */ struct udev_rules; struct udev_rules *udev_rules_new(ResolveNameTiming resolve_name_timing); @@ -66,9 +59,6 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event Hashmap *properties_list); int udev_rules_apply_static_dev_perms(struct udev_rules *rules); -ResolveNameTiming resolve_name_timing_from_string(const char *s) _pure_; -const char *resolve_name_timing_to_string(ResolveNameTiming i) _const_; - static inline usec_t udev_warn_timeout(usec_t timeout_usec) { return DIV_ROUND_UP(timeout_usec, 3); } |