summaryrefslogtreecommitdiff
path: root/src/shared/unit-name.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-07-10 17:18:09 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-10 17:18:49 +0200
commitf69614f811b133ececad4394e88f9549a017bd4e (patch)
tree056a308e4aa1eba68fd296238daacfd78833dee2 /src/shared/unit-name.h
parentbcbe497e5a73d889e8799f8a3680c303afede347 (diff)
unit: Move UnitLoadState definitions from core/unit.c to shared/unit-name.c
This makes it possible to use them from systemctl without linking against the core.
Diffstat (limited to 'src/shared/unit-name.h')
-rw-r--r--src/shared/unit-name.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
index cd30d65e3a..c6c09dd31f 100644
--- a/src/shared/unit-name.h
+++ b/src/shared/unit-name.h
@@ -27,6 +27,7 @@
#define UNIT_NAME_MAX 256
typedef enum UnitType UnitType;
+typedef enum UnitLoadState UnitLoadState;
enum UnitType {
UNIT_SERVICE = 0,
@@ -43,9 +44,22 @@ enum UnitType {
_UNIT_TYPE_INVALID = -1
};
+enum UnitLoadState {
+ UNIT_STUB,
+ 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);