]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/dropin.h
102fc9403c10650e4b373119ed7c15d2a3100fdb
[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 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 ***/
22
23 #include "hashmap.h"
24 #include "macro.h"
25 #include "set.h"
26 #include "unit-name.h"
27
28 int drop_in_file(const char *dir, const char *unit, unsigned level,
29 const char *name, char **_p, char **_q);
30
31 int write_drop_in(const char *dir, const char *unit, unsigned level,
32 const char *name, const char *data);
33
34 int write_drop_in_format(const char *dir, const char *unit, unsigned level,
35 const char *name, const char *format, ...) _printf_(5, 6);
36
37 int unit_file_find_dropin_paths(
38 const char *original_root,
39 char **lookup_path,
40 Set *unit_path_cache,
41 const char *dir_suffix,
42 const char *file_suffix,
43 Set *names,
44 char ***paths);
45
46 static inline int unit_file_find_dropin_conf_paths(
47 const char *original_root,
48 char **lookup_path,
49 Set *unit_path_cache,
50 Set *names,
51 char ***paths) {
52 return unit_file_find_dropin_paths(original_root,
53 lookup_path,
54 unit_path_cache,
55 ".d", ".conf",
56 names, paths);
57 }