]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/path-lookup.h
clean-ipc: don't filter out '.' and '..' twice
[thirdparty/systemd.git] / src / shared / path-lookup.h
1 #pragma once
2
3 /***
4 This file is part of systemd.
5
6 Copyright 2010 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <stdbool.h>
23
24 typedef struct LookupPaths LookupPaths;
25
26 #include "install.h"
27 #include "macro.h"
28
29 typedef enum LookupPathsFlags {
30 LOOKUP_PATHS_EXCLUDE_GENERATED = 1,
31 } LookupPathsFlags;
32
33 struct LookupPaths {
34 /* Where we look for unit files. This includes the individual special paths below, but also any vendor
35 * supplied, static unit file paths. */
36 char **search_path;
37
38 /* Where we shall create or remove our installation symlinks, aka "configuration", and where the user/admin
39 * shall place his own unit files. */
40 char *persistent_config;
41 char *runtime_config;
42
43 /* Where to place generated unit files (i.e. those a "generator" tool generated). Note the special semantics of
44 * this directory: the generators are flushed each time a "systemctl daemon-reload" is issued. The user should
45 * not alter these directories directly. */
46 char *generator;
47 char *generator_early;
48 char *generator_late;
49
50 /* Where to place transient unit files (i.e. those created dynamically via the bus API). Note the special
51 * semantics of this directory: all units created transiently have their unit files removed as the transient
52 * unit is unloaded. The user should not alter this directory directly. */
53 char *transient;
54
55 /* Where the snippets created by "systemctl set-property" are placed. Note that for transient units, the
56 * snippets are placed in the transient directory though (see above). The user should not alter this directory
57 * directly. */
58 char *persistent_control;
59 char *runtime_control;
60
61 /* The root directory prepended to all items above, or NULL */
62 char *root_dir;
63 };
64
65 int lookup_paths_init(LookupPaths *p, UnitFileScope scope, LookupPathsFlags flags, const char *root_dir);
66
67 int lookup_paths_reduce(LookupPaths *p);
68
69 int lookup_paths_mkdir_generator(LookupPaths *p);
70 void lookup_paths_trim_generator(LookupPaths *p);
71 void lookup_paths_flush_generator(LookupPaths *p);
72
73 void lookup_paths_free(LookupPaths *p);
74 #define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
75
76 char **generator_binary_paths(UnitFileScope scope);