]>
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, | |
19 | UNIT_FILE_MASKED, | |
20 | UNIT_FILE_MASKED_RUNTIME, | |
21 | UNIT_FILE_STATIC, | |
22 | UNIT_FILE_DISABLED, | |
23 | UNIT_FILE_INDIRECT, | |
24 | UNIT_FILE_GENERATED, | |
25 | UNIT_FILE_TRANSIENT, | |
26 | UNIT_FILE_BAD, | |
27 | _UNIT_FILE_STATE_MAX, | |
28 | _UNIT_FILE_STATE_INVALID = -1 | |
29 | }; | |
30 | ||
31 | enum UnitFileScope { | |
32 | UNIT_FILE_SYSTEM, | |
33 | UNIT_FILE_GLOBAL, | |
34 | UNIT_FILE_USER, | |
35 | _UNIT_FILE_SCOPE_MAX, | |
36 | _UNIT_FILE_SCOPE_INVALID = -1 | |
37 | }; | |
38 | ||
39 | bool unit_type_may_alias(UnitType type) _const_; | |
40 | bool unit_type_may_template(UnitType type) _const_; | |
7d1e91d1 ZJS |
41 | |
42 | int unit_validate_alias_symlink_and_warn(const char *filename, const char *target); | |
e8630e69 ZJS |
43 | |
44 | int unit_file_build_name_map( | |
45 | const LookupPaths *lp, | |
91e0ee5f | 46 | usec_t *ret_time, |
e8630e69 ZJS |
47 | Hashmap **ret_unit_ids_map, |
48 | Hashmap **ret_unit_names_map, | |
49 | Set **ret_path_cache); | |
50 | ||
51 | int unit_file_find_fragment( | |
52 | Hashmap *unit_ids_map, | |
53 | Hashmap *unit_name_map, | |
54 | const char *unit_name, | |
55 | const char **ret_fragment_path, | |
56 | Set **names); |