summaryrefslogtreecommitdiff
path: root/src/shared/path-lookup.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-24 15:31:33 +0100
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:29 +0200
commita3c4eb07106b29f7366113764cb1c8c4d6dd5646 (patch)
tree61045467e8575207dbe409d642f5ea9a1a3728d9 /src/shared/path-lookup.h
parent4447e799be18b255b11844c64b834714f4da54f8 (diff)
core: rework generator dir logic, move the dirs into LookupPaths structure
A long time ago – when generators where first introduced – the directories for them were randomly created via mkdtemp(). This was changed later so that they use fixed name directories now. Let's make use of this, and add the genrator dirs to the LookupPaths structure and into the unit file search path maintained in it. This has the benefit that the generator dirs are now normal part of the search path for all tools, and thus are shown in "systemctl list-unit-files" too.
Diffstat (limited to 'src/shared/path-lookup.h')
-rw-r--r--src/shared/path-lookup.h33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index c53d293072..1e3bce21a4 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -20,37 +20,34 @@
***/
#include <stdbool.h>
+
+typedef struct LookupPaths LookupPaths;
+typedef enum ManagerRunningAs ManagerRunningAs;
+
+#include "install.h"
#include "macro.h"
-typedef struct LookupPaths {
- char **unit_path;
-} LookupPaths;
+struct LookupPaths {
+ char **search_path;
+ char *generator;
+ char *generator_early;
+ char *generator_late;
+};
-typedef enum ManagerRunningAs {
+enum ManagerRunningAs {
MANAGER_SYSTEM,
MANAGER_USER,
_MANAGER_RUNNING_AS_MAX,
_MANAGER_RUNNING_AS_INVALID = -1
-} ManagerRunningAs;
+};
int user_config_home(char **config_home);
int user_runtime_dir(char **runtime_dir);
char **generator_paths(ManagerRunningAs running_as);
-int lookup_paths_init(LookupPaths *p,
- ManagerRunningAs running_as,
- bool personal,
- const char *root_dir,
- const char *generator,
- const char *generator_early,
- const char *generator_late);
-
-#include "install.h"
-
-int lookup_paths_init_from_scope(LookupPaths *paths,
- UnitFileScope scope,
- const char *root_dir);
+int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal, const char *root_dir);
+int lookup_paths_init_from_scope(LookupPaths *p, UnitFileScope scope, const char *root_dir);
void lookup_paths_free(LookupPaths *p);
#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)