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