chiark / gitweb /
path-lookup, systemctl: export lookup_paths_init_from_scope() from shared/install...
[elogind.git] / src / shared / path-lookup.c
index 8f75a8e83290db85540d544d82af45c4343e2852..051f1a4835c4ae99c90a0de6f34e62498f14306a 100644 (file)
@@ -398,3 +398,19 @@ void lookup_paths_free(LookupPaths *p) {
         p->sysvinit_path = p->sysvrcnd_path = NULL;
 #endif
 }
+
+int lookup_paths_init_from_scope(LookupPaths *paths,
+                                 UnitFileScope scope,
+                                 const char *root_dir) {
+        assert(paths);
+        assert(scope >= 0);
+        assert(scope < _UNIT_FILE_SCOPE_MAX);
+
+        zero(*paths);
+
+        return lookup_paths_init(paths,
+                                 scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER,
+                                 scope == UNIT_FILE_USER,
+                                 root_dir,
+                                 NULL, NULL, NULL);
+}