chiark / gitweb /
hashmap.h: fix coding style issue
[elogind.git] / src / shared / unit-name.h
index cd30d65e3a43b52f9bd3e428aa9d1dfe4a793818..c28d55d3e84360c9d70ebd831880e6b9514f2ac1 100644 (file)
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foounitnamehfoo
-#define foounitnamehfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -27,6 +26,7 @@
 #define UNIT_NAME_MAX 256
 
 typedef enum UnitType UnitType;
+typedef enum UnitLoadState UnitLoadState;
 
 enum UnitType {
         UNIT_SERVICE = 0,
@@ -43,9 +43,22 @@ enum UnitType {
         _UNIT_TYPE_INVALID = -1
 };
 
+enum UnitLoadState {
+        UNIT_STUB = 0,
+        UNIT_LOADED,
+        UNIT_ERROR,
+        UNIT_MERGED,
+        UNIT_MASKED,
+        _UNIT_LOAD_STATE_MAX,
+        _UNIT_LOAD_STATE_INVALID = -1
+};
+
 const char *unit_type_to_string(UnitType i);
 UnitType unit_type_from_string(const char *s);
 
+const char *unit_load_state_to_string(UnitLoadState i);
+UnitLoadState unit_load_state_from_string(const char *s);
+
 int unit_name_to_instance(const char *n, char **instance);
 char* unit_name_to_prefix(const char *n);
 char* unit_name_to_prefix_and_instance(const char *n);
@@ -66,6 +79,7 @@ char *unit_name_path_escape(const char *f);
 char *unit_name_path_unescape(const char *f);
 
 bool unit_name_is_template(const char *n);
+bool unit_name_is_instance(const char *n);
 
 char *unit_name_replace_instance(const char *f, const char *i);
 
@@ -78,5 +92,4 @@ char *unit_name_to_path(const char *name);
 char *unit_dbus_path_from_name(const char *name);
 
 char *unit_name_mangle(const char *name);
-
-#endif
+char *snapshot_name_mangle(const char *name);