/src/systemd/src/shared/install.h
Line | Count | Source |
1 | | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | | #pragma once |
3 | | |
4 | | #include "forward.h" |
5 | | #include "runtime-scope.h" |
6 | | #include "unit-file.h" |
7 | | |
8 | | typedef enum UnitFilePresetMode { |
9 | | UNIT_FILE_PRESET_FULL, |
10 | | UNIT_FILE_PRESET_ENABLE_ONLY, |
11 | | UNIT_FILE_PRESET_DISABLE_ONLY, |
12 | | _UNIT_FILE_PRESET_MODE_MAX, |
13 | | _UNIT_FILE_PRESET_MODE_INVALID = -EINVAL, |
14 | | } UnitFilePresetMode; |
15 | | |
16 | | typedef enum InstallChangeType { |
17 | | INSTALL_CHANGE_SYMLINK, |
18 | | INSTALL_CHANGE_UNLINK, |
19 | | INSTALL_CHANGE_IS_MASKED, |
20 | | INSTALL_CHANGE_IS_MASKED_GENERATOR, |
21 | | INSTALL_CHANGE_IS_DANGLING, |
22 | | INSTALL_CHANGE_DESTINATION_NOT_PRESENT, |
23 | | INSTALL_CHANGE_AUXILIARY_FAILED, |
24 | | _INSTALL_CHANGE_TYPE_MAX, |
25 | | _INSTALL_CHANGE_INVALID = -EINVAL, |
26 | | _INSTALL_CHANGE_ERRNO_MAX = -ERRNO_MAX, /* Ensure this type covers the whole negative errno range */ |
27 | | } InstallChangeType; |
28 | | |
29 | 0 | static inline bool INSTALL_CHANGE_TYPE_VALID(InstallChangeType t) { |
30 | 0 | return t >= _INSTALL_CHANGE_ERRNO_MAX && t < _INSTALL_CHANGE_TYPE_MAX; |
31 | 0 | } Unexecuted instantiation: fuzz-manager-serialize.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: fuzz-unit-file.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: systemctl-util.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: systemctl.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bus-unit-util.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: install-printf.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: install.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: load-fragment-gperf.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: automount.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-bind-iface.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-firewall.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-foreign.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-restrict-fs.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-restrict-fsaccess.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-restrict-ifaces.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: bpf-socket-bind.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: cgroup.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-automount.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-cgroup.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-device.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-execute.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-job.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-kill.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-manager.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-mount.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-path.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-scope.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-service.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-slice.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-socket.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-swap.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-timer.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-unit.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus-util.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dbus.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: device.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: dynamic-user.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: emergency-action.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: exec-credential.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: execute.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: execute-serialize.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: job.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: load-dropin.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: load-fragment.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: luo.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: manager-dump.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: manager-serialize.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: manager.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: mount.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: path.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: scope.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: service.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: slice.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: socket.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: swap.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: target.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: timer.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: transaction.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: unit-printf.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: unit-serialize.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: unit.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-automount.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-cgroup.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-common.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-dynamic-user.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-execute.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-job.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-kill.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-manager.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-metrics.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-mount.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-path.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-scope.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-service.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-socket.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-swap.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-timer.c:INSTALL_CHANGE_TYPE_VALID Unexecuted instantiation: varlink-unit.c:INSTALL_CHANGE_TYPE_VALID |
32 | | |
33 | | typedef enum UnitFileFlags { |
34 | | UNIT_FILE_RUNTIME = 1 << 0, /* Public API via DBUS, do not change */ |
35 | | UNIT_FILE_FORCE = 1 << 1, /* Public API via DBUS, do not change */ |
36 | | UNIT_FILE_PORTABLE = 1 << 2, /* Public API via DBUS, do not change */ |
37 | | UNIT_FILE_DRY_RUN = 1 << 3, |
38 | | UNIT_FILE_IGNORE_AUXILIARY_FAILURE = 1 << 4, |
39 | | _UNIT_FILE_FLAGS_MASK_PUBLIC = UNIT_FILE_RUNTIME|UNIT_FILE_PORTABLE|UNIT_FILE_FORCE, |
40 | | } UnitFileFlags; |
41 | | |
42 | | typedef enum SearchFlags { |
43 | | SEARCH_LOAD = 1 << 0, |
44 | | SEARCH_FOLLOW_CONFIG_SYMLINKS = 1 << 1, |
45 | | SEARCH_DROPIN = 1 << 2, |
46 | | SEARCH_IGNORE_TEMPLATE = 1 << 3, /* Don't look up the template if the instance does not exist. */ |
47 | | } SearchFlags; |
48 | | |
49 | | /* type can be either one of the INSTALL_CHANGE_SYMLINK, INSTALL_CHANGE_UNLINK, … listed above, or a negative |
50 | | * errno value. |
51 | | * |
52 | | * If source is specified, it should be the contents of the path symlink. In case of an error, source should |
53 | | * be the existing symlink contents or NULL. */ |
54 | | typedef struct InstallChange { |
55 | | int type; /* INSTALL_CHANGE_SYMLINK, … if positive, errno if negative */ |
56 | | char *path; |
57 | | char *source; |
58 | | } InstallChange; |
59 | | |
60 | 0 | static inline bool install_changes_have_modification(const InstallChange *changes, size_t n_changes) { |
61 | 0 | FOREACH_ARRAY(i, changes, n_changes) |
62 | 0 | if (IN_SET(i->type, INSTALL_CHANGE_SYMLINK, INSTALL_CHANGE_UNLINK)) |
63 | 0 | return true; |
64 | 0 | return false; |
65 | 0 | } Unexecuted instantiation: fuzz-manager-serialize.c:install_changes_have_modification Unexecuted instantiation: fuzz-unit-file.c:install_changes_have_modification Unexecuted instantiation: systemctl-util.c:install_changes_have_modification Unexecuted instantiation: systemctl.c:install_changes_have_modification Unexecuted instantiation: bus-unit-util.c:install_changes_have_modification Unexecuted instantiation: install-printf.c:install_changes_have_modification Unexecuted instantiation: install.c:install_changes_have_modification Unexecuted instantiation: load-fragment-gperf.c:install_changes_have_modification Unexecuted instantiation: automount.c:install_changes_have_modification Unexecuted instantiation: bpf-bind-iface.c:install_changes_have_modification Unexecuted instantiation: bpf-firewall.c:install_changes_have_modification Unexecuted instantiation: bpf-foreign.c:install_changes_have_modification Unexecuted instantiation: bpf-restrict-fs.c:install_changes_have_modification Unexecuted instantiation: bpf-restrict-fsaccess.c:install_changes_have_modification Unexecuted instantiation: bpf-restrict-ifaces.c:install_changes_have_modification Unexecuted instantiation: bpf-socket-bind.c:install_changes_have_modification Unexecuted instantiation: cgroup.c:install_changes_have_modification Unexecuted instantiation: dbus-automount.c:install_changes_have_modification Unexecuted instantiation: dbus-cgroup.c:install_changes_have_modification Unexecuted instantiation: dbus-device.c:install_changes_have_modification Unexecuted instantiation: dbus-execute.c:install_changes_have_modification Unexecuted instantiation: dbus-job.c:install_changes_have_modification Unexecuted instantiation: dbus-kill.c:install_changes_have_modification Unexecuted instantiation: dbus-manager.c:install_changes_have_modification Unexecuted instantiation: dbus-mount.c:install_changes_have_modification Unexecuted instantiation: dbus-path.c:install_changes_have_modification Unexecuted instantiation: dbus-scope.c:install_changes_have_modification Unexecuted instantiation: dbus-service.c:install_changes_have_modification Unexecuted instantiation: dbus-slice.c:install_changes_have_modification Unexecuted instantiation: dbus-socket.c:install_changes_have_modification Unexecuted instantiation: dbus-swap.c:install_changes_have_modification Unexecuted instantiation: dbus-timer.c:install_changes_have_modification Unexecuted instantiation: dbus-unit.c:install_changes_have_modification Unexecuted instantiation: dbus-util.c:install_changes_have_modification Unexecuted instantiation: dbus.c:install_changes_have_modification Unexecuted instantiation: device.c:install_changes_have_modification Unexecuted instantiation: dynamic-user.c:install_changes_have_modification Unexecuted instantiation: emergency-action.c:install_changes_have_modification Unexecuted instantiation: exec-credential.c:install_changes_have_modification Unexecuted instantiation: execute.c:install_changes_have_modification Unexecuted instantiation: execute-serialize.c:install_changes_have_modification Unexecuted instantiation: job.c:install_changes_have_modification Unexecuted instantiation: load-dropin.c:install_changes_have_modification Unexecuted instantiation: load-fragment.c:install_changes_have_modification Unexecuted instantiation: luo.c:install_changes_have_modification Unexecuted instantiation: manager-dump.c:install_changes_have_modification Unexecuted instantiation: manager-serialize.c:install_changes_have_modification Unexecuted instantiation: manager.c:install_changes_have_modification Unexecuted instantiation: mount.c:install_changes_have_modification Unexecuted instantiation: path.c:install_changes_have_modification Unexecuted instantiation: scope.c:install_changes_have_modification Unexecuted instantiation: service.c:install_changes_have_modification Unexecuted instantiation: slice.c:install_changes_have_modification Unexecuted instantiation: socket.c:install_changes_have_modification Unexecuted instantiation: swap.c:install_changes_have_modification Unexecuted instantiation: target.c:install_changes_have_modification Unexecuted instantiation: timer.c:install_changes_have_modification Unexecuted instantiation: transaction.c:install_changes_have_modification Unexecuted instantiation: unit-printf.c:install_changes_have_modification Unexecuted instantiation: unit-serialize.c:install_changes_have_modification Unexecuted instantiation: unit.c:install_changes_have_modification Unexecuted instantiation: varlink.c:install_changes_have_modification Unexecuted instantiation: varlink-automount.c:install_changes_have_modification Unexecuted instantiation: varlink-cgroup.c:install_changes_have_modification Unexecuted instantiation: varlink-common.c:install_changes_have_modification Unexecuted instantiation: varlink-dynamic-user.c:install_changes_have_modification Unexecuted instantiation: varlink-execute.c:install_changes_have_modification Unexecuted instantiation: varlink-job.c:install_changes_have_modification Unexecuted instantiation: varlink-kill.c:install_changes_have_modification Unexecuted instantiation: varlink-manager.c:install_changes_have_modification Unexecuted instantiation: varlink-metrics.c:install_changes_have_modification Unexecuted instantiation: varlink-mount.c:install_changes_have_modification Unexecuted instantiation: varlink-path.c:install_changes_have_modification Unexecuted instantiation: varlink-scope.c:install_changes_have_modification Unexecuted instantiation: varlink-service.c:install_changes_have_modification Unexecuted instantiation: varlink-socket.c:install_changes_have_modification Unexecuted instantiation: varlink-swap.c:install_changes_have_modification Unexecuted instantiation: varlink-timer.c:install_changes_have_modification Unexecuted instantiation: varlink-unit.c:install_changes_have_modification |
66 | | |
67 | | typedef struct UnitFileList { |
68 | | char *path; |
69 | | UnitFileState state; |
70 | | } UnitFileList; |
71 | | |
72 | | typedef enum InstallMode { |
73 | | INSTALL_MODE_REGULAR, |
74 | | INSTALL_MODE_LINKED, |
75 | | INSTALL_MODE_ALIAS, |
76 | | INSTALL_MODE_MASKED, |
77 | | _INSTALL_MODE_MAX, |
78 | | _INSTALL_MODE_INVALID = -EINVAL, |
79 | | } InstallMode; |
80 | | |
81 | | typedef struct InstallInfo { |
82 | | char *name; |
83 | | char *path; |
84 | | char *root; |
85 | | |
86 | | char **aliases; |
87 | | char **wanted_by; |
88 | | char **required_by; |
89 | | char **upheld_by; |
90 | | char **also; |
91 | | |
92 | | char *default_instance; |
93 | | char *symlink_target; |
94 | | |
95 | | InstallMode install_mode; |
96 | | bool auxiliary; |
97 | | } InstallInfo; |
98 | | |
99 | | int unit_file_enable( |
100 | | RuntimeScope scope, |
101 | | UnitFileFlags flags, |
102 | | const char *root_dir, |
103 | | char * const *names_or_paths, |
104 | | InstallChange **changes, |
105 | | size_t *n_changes); |
106 | | int unit_file_disable( |
107 | | RuntimeScope scope, |
108 | | UnitFileFlags flags, |
109 | | const char *root_dir, |
110 | | char * const *files, |
111 | | InstallChange **changes, |
112 | | size_t *n_changes); |
113 | | int unit_file_reenable( |
114 | | RuntimeScope scope, |
115 | | UnitFileFlags flags, |
116 | | const char *root_dir, |
117 | | char * const *names_or_paths, |
118 | | InstallChange **changes, |
119 | | size_t *n_changes); |
120 | | int unit_file_preset( |
121 | | RuntimeScope scope, |
122 | | UnitFileFlags file_flags, |
123 | | const char *root_dir, |
124 | | char * const *names, |
125 | | UnitFilePresetMode mode, |
126 | | InstallChange **changes, |
127 | | size_t *n_changes); |
128 | | int unit_file_preset_all( |
129 | | RuntimeScope scope, |
130 | | UnitFileFlags file_flags, |
131 | | const char *root_dir, |
132 | | UnitFilePresetMode mode, |
133 | | InstallChange **changes, |
134 | | size_t *n_changes); |
135 | | int unit_file_mask( |
136 | | RuntimeScope scope, |
137 | | UnitFileFlags flags, |
138 | | const char *root_dir, |
139 | | char * const *names, |
140 | | InstallChange **changes, |
141 | | size_t *n_changes); |
142 | | int unit_file_unmask( |
143 | | RuntimeScope scope, |
144 | | UnitFileFlags flags, |
145 | | const char *root_dir, |
146 | | char * const *names, |
147 | | InstallChange **changes, |
148 | | size_t *n_changes); |
149 | | int unit_file_link( |
150 | | RuntimeScope scope, |
151 | | UnitFileFlags flags, |
152 | | const char *root_dir, |
153 | | char * const *files, |
154 | | InstallChange **changes, |
155 | | size_t *n_changes); |
156 | | int unit_file_revert( |
157 | | RuntimeScope scope, |
158 | | const char *root_dir, |
159 | | char * const *names, |
160 | | InstallChange **changes, |
161 | | size_t *n_changes); |
162 | | int unit_file_set_default( |
163 | | RuntimeScope scope, |
164 | | UnitFileFlags flags, |
165 | | const char *root_dir, |
166 | | const char *name, |
167 | | InstallChange **changes, |
168 | | size_t *n_changes); |
169 | | int unit_file_get_default( |
170 | | RuntimeScope scope, |
171 | | const char *root_dir, |
172 | | char **ret); |
173 | | int unit_file_add_dependency( |
174 | | RuntimeScope scope, |
175 | | UnitFileFlags flags, |
176 | | const char *root_dir, |
177 | | char * const *names, |
178 | | const char *target, |
179 | | UnitDependency dep, |
180 | | InstallChange **changes, |
181 | | size_t *n_changes); |
182 | | |
183 | | int unit_file_lookup_state( |
184 | | RuntimeScope scope, |
185 | | const LookupPaths *lp, |
186 | | const char *name, |
187 | | UnitFileState *ret); |
188 | | |
189 | | int unit_file_get_state(RuntimeScope scope, const char *root_dir, const char *filename, UnitFileState *ret); |
190 | | |
191 | | int unit_file_exists_full( |
192 | | RuntimeScope scope, |
193 | | const LookupPaths *lp, |
194 | | SearchFlags flags, |
195 | | const char *name, |
196 | | char **ret_path); |
197 | | |
198 | 0 | static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *lp, const char *name) { |
199 | | return unit_file_exists_full(scope, lp, 0, name, NULL); |
200 | 0 | } Unexecuted instantiation: fuzz-manager-serialize.c:unit_file_exists Unexecuted instantiation: fuzz-unit-file.c:unit_file_exists Unexecuted instantiation: systemctl-util.c:unit_file_exists Unexecuted instantiation: systemctl.c:unit_file_exists Unexecuted instantiation: bus-unit-util.c:unit_file_exists Unexecuted instantiation: install-printf.c:unit_file_exists Unexecuted instantiation: install.c:unit_file_exists Unexecuted instantiation: load-fragment-gperf.c:unit_file_exists Unexecuted instantiation: automount.c:unit_file_exists Unexecuted instantiation: bpf-bind-iface.c:unit_file_exists Unexecuted instantiation: bpf-firewall.c:unit_file_exists Unexecuted instantiation: bpf-foreign.c:unit_file_exists Unexecuted instantiation: bpf-restrict-fs.c:unit_file_exists Unexecuted instantiation: bpf-restrict-fsaccess.c:unit_file_exists Unexecuted instantiation: bpf-restrict-ifaces.c:unit_file_exists Unexecuted instantiation: bpf-socket-bind.c:unit_file_exists Unexecuted instantiation: cgroup.c:unit_file_exists Unexecuted instantiation: dbus-automount.c:unit_file_exists Unexecuted instantiation: dbus-cgroup.c:unit_file_exists Unexecuted instantiation: dbus-device.c:unit_file_exists Unexecuted instantiation: dbus-execute.c:unit_file_exists Unexecuted instantiation: dbus-job.c:unit_file_exists Unexecuted instantiation: dbus-kill.c:unit_file_exists Unexecuted instantiation: dbus-manager.c:unit_file_exists Unexecuted instantiation: dbus-mount.c:unit_file_exists Unexecuted instantiation: dbus-path.c:unit_file_exists Unexecuted instantiation: dbus-scope.c:unit_file_exists Unexecuted instantiation: dbus-service.c:unit_file_exists Unexecuted instantiation: dbus-slice.c:unit_file_exists Unexecuted instantiation: dbus-socket.c:unit_file_exists Unexecuted instantiation: dbus-swap.c:unit_file_exists Unexecuted instantiation: dbus-timer.c:unit_file_exists Unexecuted instantiation: dbus-unit.c:unit_file_exists Unexecuted instantiation: dbus-util.c:unit_file_exists Unexecuted instantiation: dbus.c:unit_file_exists Unexecuted instantiation: device.c:unit_file_exists Unexecuted instantiation: dynamic-user.c:unit_file_exists Unexecuted instantiation: emergency-action.c:unit_file_exists Unexecuted instantiation: exec-credential.c:unit_file_exists Unexecuted instantiation: execute.c:unit_file_exists Unexecuted instantiation: execute-serialize.c:unit_file_exists Unexecuted instantiation: job.c:unit_file_exists Unexecuted instantiation: load-dropin.c:unit_file_exists Unexecuted instantiation: load-fragment.c:unit_file_exists Unexecuted instantiation: luo.c:unit_file_exists Unexecuted instantiation: manager-dump.c:unit_file_exists Unexecuted instantiation: manager-serialize.c:unit_file_exists Unexecuted instantiation: manager.c:unit_file_exists Unexecuted instantiation: mount.c:unit_file_exists Unexecuted instantiation: path.c:unit_file_exists Unexecuted instantiation: scope.c:unit_file_exists Unexecuted instantiation: service.c:unit_file_exists Unexecuted instantiation: slice.c:unit_file_exists Unexecuted instantiation: socket.c:unit_file_exists Unexecuted instantiation: swap.c:unit_file_exists Unexecuted instantiation: target.c:unit_file_exists Unexecuted instantiation: timer.c:unit_file_exists Unexecuted instantiation: transaction.c:unit_file_exists Unexecuted instantiation: unit-printf.c:unit_file_exists Unexecuted instantiation: unit-serialize.c:unit_file_exists Unexecuted instantiation: unit.c:unit_file_exists Unexecuted instantiation: varlink.c:unit_file_exists Unexecuted instantiation: varlink-automount.c:unit_file_exists Unexecuted instantiation: varlink-cgroup.c:unit_file_exists Unexecuted instantiation: varlink-common.c:unit_file_exists Unexecuted instantiation: varlink-dynamic-user.c:unit_file_exists Unexecuted instantiation: varlink-execute.c:unit_file_exists Unexecuted instantiation: varlink-job.c:unit_file_exists Unexecuted instantiation: varlink-kill.c:unit_file_exists Unexecuted instantiation: varlink-manager.c:unit_file_exists Unexecuted instantiation: varlink-metrics.c:unit_file_exists Unexecuted instantiation: varlink-mount.c:unit_file_exists Unexecuted instantiation: varlink-path.c:unit_file_exists Unexecuted instantiation: varlink-scope.c:unit_file_exists Unexecuted instantiation: varlink-service.c:unit_file_exists Unexecuted instantiation: varlink-socket.c:unit_file_exists Unexecuted instantiation: varlink-swap.c:unit_file_exists Unexecuted instantiation: varlink-timer.c:unit_file_exists Unexecuted instantiation: varlink-unit.c:unit_file_exists |
201 | | |
202 | | int unit_file_get_list(RuntimeScope scope, const char *root_dir, char * const *states, char * const *patterns, Hashmap **ret); |
203 | | |
204 | | InstallChangeType install_changes_add(InstallChange **changes, size_t *n_changes, InstallChangeType type, const char *path, const char *source); |
205 | | void install_changes_free(InstallChange *array, size_t n); |
206 | | |
207 | | void install_change_dump_success(const InstallChange *change); |
208 | | int install_change_dump_error(const InstallChange *change, char **ret_errmsg, const char **ret_bus_error); |
209 | | int install_changes_dump( |
210 | | int error, |
211 | | const char *verb, |
212 | | const InstallChange *changes, |
213 | | size_t n_changes, |
214 | | bool quiet); |
215 | | |
216 | | int unit_file_verify_alias( |
217 | | const InstallInfo *info, |
218 | | const char *dst, |
219 | | char **ret_dst, |
220 | | InstallChange **changes, |
221 | | size_t *n_changes); |
222 | | |
223 | | typedef struct UnitFilePresetRule UnitFilePresetRule; |
224 | | |
225 | | typedef struct { |
226 | | UnitFilePresetRule *rules; |
227 | | size_t n_rules; |
228 | | bool initialized; |
229 | | } UnitFilePresets; |
230 | | |
231 | | typedef enum PresetAction { |
232 | | PRESET_UNKNOWN, |
233 | | PRESET_ENABLE, |
234 | | PRESET_DISABLE, |
235 | | PRESET_IGNORE, |
236 | | _PRESET_ACTION_MAX, |
237 | | _PRESET_ACTION_INVALID = -EINVAL, |
238 | | _PRESET_ACTION_ERRNO_MAX = -ERRNO_MAX, /* Ensure this type covers the whole negative errno range */ |
239 | | } PresetAction; |
240 | | |
241 | | DECLARE_STRING_TABLE_LOOKUP_TO_STRING(preset_action_past_tense, PresetAction); |
242 | | |
243 | | void unit_file_presets_done(UnitFilePresets *p); |
244 | | PresetAction unit_file_query_preset(RuntimeScope scope, const char *root_dir, const char *name, UnitFilePresets *cached); |
245 | | |
246 | | DECLARE_STRING_TABLE_LOOKUP(unit_file_state, UnitFileState); |
247 | | /* from_string conversion is unreliable because of the overlap between -EPERM and -1 for error. */ |
248 | | |
249 | | DECLARE_STRING_TABLE_LOOKUP(install_change_type, InstallChangeType); |
250 | | |
251 | | DECLARE_STRING_TABLE_LOOKUP(unit_file_preset_mode, UnitFilePresetMode); |