diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-03-10 09:47:10 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-10 09:47:39 +0100 |
commit | 4870133bfaaf97189a970a29bf47e0e38fa721aa (patch) | |
tree | d2fa9a5699a8b4c948179afabf3da2f9da322ce5 /src/basic/path-lookup.h | |
parent | 5f64d2bf332371bdfdcb91b588e57d4c0c20428f (diff) | |
download | systemd-4870133bfaaf97189a970a29bf47e0e38fa721aa.tar.gz |
basic: add RuntimeScope enum
In various tools and services we have a per-system and per-user concept.
So far we sometimes used a boolean indicating whether we are in system
mode, or a reversed boolean indicating whether we are in user mode, or
the LookupScope enum used by the lookup path logic.
Let's address that, in introduce a common enum for this, we can use all
across the board.
This is mostly just search/replace, no actual code changes.
Diffstat (limited to 'src/basic/path-lookup.h')
-rw-r--r-- | src/basic/path-lookup.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/basic/path-lookup.h b/src/basic/path-lookup.h index 46eb32c4b0..6d6163fb9d 100644 --- a/src/basic/path-lookup.h +++ b/src/basic/path-lookup.h @@ -5,6 +5,7 @@ #include "constants.h" #include "macro.h" +#include "runtime-scope.h" typedef enum LookupPathsFlags { LOOKUP_PATHS_EXCLUDE_GENERATED = 1 << 0, @@ -12,14 +13,6 @@ typedef enum LookupPathsFlags { LOOKUP_PATHS_SPLIT_USR = 1 << 2, } LookupPathsFlags; -typedef enum LookupScope { - LOOKUP_SCOPE_SYSTEM, - LOOKUP_SCOPE_GLOBAL, - LOOKUP_SCOPE_USER, - _LOOKUP_SCOPE_MAX, - _LOOKUP_SCOPE_INVALID = -EINVAL, -} LookupScope; - typedef struct LookupPaths { /* Where we look for unit files. This includes the individual special paths below, but also any vendor * supplied, static unit file paths. */ @@ -59,8 +52,8 @@ typedef struct LookupPaths { char *temporary_dir; } LookupPaths; -int lookup_paths_init(LookupPaths *lp, LookupScope scope, LookupPathsFlags flags, const char *root_dir); -int lookup_paths_init_or_warn(LookupPaths *lp, LookupScope scope, LookupPathsFlags flags, const char *root_dir); +int lookup_paths_init(LookupPaths *lp, RuntimeScope scope, LookupPathsFlags flags, const char *root_dir); +int lookup_paths_init_or_warn(LookupPaths *lp, RuntimeScope scope, LookupPathsFlags flags, const char *root_dir); int xdg_user_dirs(char ***ret_config_dirs, char ***ret_data_dirs); int xdg_user_runtime_dir(char **ret, const char *suffix); @@ -73,8 +66,8 @@ bool path_is_user_config_dir(const char *path); void lookup_paths_log(LookupPaths *p); void lookup_paths_free(LookupPaths *p); -char **generator_binary_paths(LookupScope scope); -char **env_generator_binary_paths(bool is_system); +char **generator_binary_paths(RuntimeScope scope); +char **env_generator_binary_paths(RuntimeScope scope); #define NETWORK_DIRS ((const char* const*) CONF_PATHS_STRV("systemd/network")) #define NETWORK_DIRS_NULSTR CONF_PATHS_NULSTR("systemd/network") |