]>
Commit | Line | Data |
---|---|---|
5cfa33e0 ZJS |
1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
2 | #pragma once | |
3 | ||
4 | #include <stdbool.h> | |
5 | ||
e8630e69 | 6 | #include "hashmap.h" |
91e0ee5f | 7 | #include "time-util.h" |
5cfa33e0 ZJS |
8 | #include "unit-name.h" |
9 | ||
10 | typedef enum UnitFileState UnitFileState; | |
11 | typedef enum UnitFileScope UnitFileScope; | |
e8630e69 | 12 | typedef struct LookupPaths LookupPaths; |
5cfa33e0 ZJS |
13 | |
14 | enum UnitFileState { | |
15 | UNIT_FILE_ENABLED, | |
16 | UNIT_FILE_ENABLED_RUNTIME, | |
17 | UNIT_FILE_LINKED, | |
18 | UNIT_FILE_LINKED_RUNTIME, | |
15d7ab87 | 19 | UNIT_FILE_ALIAS, |
5cfa33e0 ZJS |
20 | UNIT_FILE_MASKED, |
21 | UNIT_FILE_MASKED_RUNTIME, | |
22 | UNIT_FILE_STATIC, | |
23 | UNIT_FILE_DISABLED, | |
24 | UNIT_FILE_INDIRECT, | |
25 | UNIT_FILE_GENERATED, | |
26 | UNIT_FILE_TRANSIENT, | |
27 | UNIT_FILE_BAD, | |
28 | _UNIT_FILE_STATE_MAX, | |
29 | _UNIT_FILE_STATE_INVALID = -1 | |
30 | }; | |
31 | ||
32 | enum UnitFileScope { | |
33 | UNIT_FILE_SYSTEM, | |
34 | UNIT_FILE_GLOBAL, | |
35 | UNIT_FILE_USER, | |
36 | _UNIT_FILE_SCOPE_MAX, | |
37 | _UNIT_FILE_SCOPE_INVALID = -1 | |
38 | }; | |
39 | ||
40 | bool unit_type_may_alias(UnitType type) _const_; | |
41 | bool unit_type_may_template(UnitType type) _const_; | |
7d1e91d1 | 42 | |
1bf15585 | 43 | int unit_symlink_name_compatible(const char *symlink, const char *target, bool instance_propagation); |
7d1e91d1 | 44 | int unit_validate_alias_symlink_and_warn(const char *filename, const char *target); |
e8630e69 | 45 | |
d904afc7 | 46 | bool lookup_paths_mtime_good(const LookupPaths *lp, usec_t mtime); |
e8630e69 ZJS |
47 | int unit_file_build_name_map( |
48 | const LookupPaths *lp, | |
91e0ee5f | 49 | usec_t *ret_time, |
e8630e69 ZJS |
50 | Hashmap **ret_unit_ids_map, |
51 | Hashmap **ret_unit_names_map, | |
52 | Set **ret_path_cache); | |
53 | ||
54 | int unit_file_find_fragment( | |
55 | Hashmap *unit_ids_map, | |
56 | Hashmap *unit_name_map, | |
57 | const char *unit_name, | |
58 | const char **ret_fragment_path, | |
59 | Set **names); | |
da33cba0 ZJS |
60 | |
61 | const char* runlevel_to_target(const char *rl); |