| |
| #pragma once |
| |
| #include <stdbool.h> |
| |
| typedef struct LookupPaths LookupPaths; |
| |
| #include "install.h" |
| #include "macro.h" |
| |
| typedef enum LookupPathsFlags { |
| LOOKUP_PATHS_EXCLUDE_GENERATED = 1 << 0, |
| LOOKUP_PATHS_TEMPORARY_GENERATED = 1 << 1, |
| LOOKUP_PATHS_SPLIT_USR = 1 << 2, |
| } LookupPathsFlags; |
| |
| struct LookupPaths { |
| |
| |
| char **search_path; |
| |
| |
| |
| char *persistent_config; |
| char *runtime_config; |
| |
| |
| |
| |
| char *generator; |
| char *generator_early; |
| char *generator_late; |
| |
| |
| |
| |
| char *transient; |
| |
| |
| |
| |
| char *persistent_control; |
| char *runtime_control; |
| |
| |
| char *root_dir; |
| |
| |
| char *temporary_dir; |
| }; |
| |
| int lookup_paths_init(LookupPaths *p, UnitFileScope 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); |
| int xdg_user_config_dir(char **ret, const char *suffix); |
| int xdg_user_data_dir(char **ret, const char *suffix); |
| bool path_is_user_data_dir(const char *path); |
| bool path_is_user_config_dir(const char *path); |
| |
| int lookup_paths_reduce(LookupPaths *p); |
| |
| int lookup_paths_mkdir_generator(LookupPaths *p); |
| void lookup_paths_trim_generator(LookupPaths *p); |
| void lookup_paths_flush_generator(LookupPaths *p); |
| |
| void lookup_paths_free(LookupPaths *p); |
| |
| char **generator_binary_paths(UnitFileScope scope); |