]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/dropin.h
tree-wide: beautify remaining copyright statements
[thirdparty/systemd.git] / src / shared / dropin.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright © 2014 Zbigniew Jędrzejewski-Szmek
6 ***/
7
8 #include "hashmap.h"
9 #include "macro.h"
10 #include "set.h"
11 #include "unit-name.h"
12
13 int drop_in_file(const char *dir, const char *unit, unsigned level,
14 const char *name, char **_p, char **_q);
15
16 int write_drop_in(const char *dir, const char *unit, unsigned level,
17 const char *name, const char *data);
18
19 int write_drop_in_format(const char *dir, const char *unit, unsigned level,
20 const char *name, const char *format, ...) _printf_(5, 6);
21
22 int unit_file_find_dropin_paths(
23 const char *original_root,
24 char **lookup_path,
25 Set *unit_path_cache,
26 const char *dir_suffix,
27 const char *file_suffix,
28 Set *names,
29 char ***paths);
30
31 static inline int unit_file_find_dropin_conf_paths(
32 const char *original_root,
33 char **lookup_path,
34 Set *unit_path_cache,
35 Set *names,
36 char ***paths) {
37
38 return unit_file_find_dropin_paths(original_root,
39 lookup_path,
40 unit_path_cache,
41 ".d", ".conf",
42 names, paths);
43 }