]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/unit-file.h
Merge pull request #13365 from keszybz/fix-commits-from-pr-13246
[thirdparty/systemd.git] / src / shared / unit-file.h
CommitLineData
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
10typedef enum UnitFileState UnitFileState;
11typedef enum UnitFileScope UnitFileScope;
e8630e69 12typedef struct LookupPaths LookupPaths;
5cfa33e0
ZJS
13
14enum 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
31enum 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
39bool unit_type_may_alias(UnitType type) _const_;
40bool unit_type_may_template(UnitType type) _const_;
7d1e91d1
ZJS
41
42int unit_validate_alias_symlink_and_warn(const char *filename, const char *target);
e8630e69
ZJS
43
44int 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
51int 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);