]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/dropin.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / shared / dropin.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
29686440
ZJS
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
a8fbdf54 23#include "hashmap.h"
f5a4b0d3 24#include "macro.h"
1a7f1b38
ZJS
25#include "set.h"
26#include "unit-name.h"
f5a4b0d3 27
8eea8687 28int drop_in_file(const char *dir, const char *unit, unsigned level,
29686440
ZJS
29 const char *name, char **_p, char **_q);
30
8eea8687 31int write_drop_in(const char *dir, const char *unit, unsigned level,
29686440
ZJS
32 const char *name, const char *data);
33
8eea8687 34int write_drop_in_format(const char *dir, const char *unit, unsigned level,
f5a4b0d3 35 const char *name, const char *format, ...) _printf_(5, 6);
1a7f1b38 36
1a7f1b38 37int unit_file_find_dropin_paths(
17e78d18 38 const char *original_root,
1a7f1b38
ZJS
39 char **lookup_path,
40 Set *unit_path_cache,
95778782
ZJS
41 const char *dir_suffix,
42 const char *file_suffix,
1a7f1b38
ZJS
43 Set *names,
44 char ***paths);
95778782
ZJS
45
46static 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}