Move UnitActiveState to basic/
Preparation to allow systemctl to query the list of unit states.
This commit is contained in:
@@ -839,6 +839,17 @@ static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(unit_load_state, UnitLoadState);
|
||||
|
||||
static const char* const unit_active_state_table[_UNIT_ACTIVE_STATE_MAX] = {
|
||||
[UNIT_ACTIVE] = "active",
|
||||
[UNIT_RELOADING] = "reloading",
|
||||
[UNIT_INACTIVE] = "inactive",
|
||||
[UNIT_FAILED] = "failed",
|
||||
[UNIT_ACTIVATING] = "activating",
|
||||
[UNIT_DEACTIVATING] = "deactivating"
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(unit_active_state, UnitActiveState);
|
||||
|
||||
static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
|
||||
[UNIT_REQUIRES] = "Requires",
|
||||
[UNIT_REQUIRES_OVERRIDABLE] = "RequiresOverridable",
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
typedef enum UnitType UnitType;
|
||||
typedef enum UnitLoadState UnitLoadState;
|
||||
typedef enum UnitActiveState UnitActiveState;
|
||||
typedef enum UnitDependency UnitDependency;
|
||||
|
||||
enum UnitType {
|
||||
@@ -60,6 +61,17 @@ enum UnitLoadState {
|
||||
_UNIT_LOAD_STATE_INVALID = -1
|
||||
};
|
||||
|
||||
enum UnitActiveState {
|
||||
UNIT_ACTIVE,
|
||||
UNIT_RELOADING,
|
||||
UNIT_INACTIVE,
|
||||
UNIT_FAILED,
|
||||
UNIT_ACTIVATING,
|
||||
UNIT_DEACTIVATING,
|
||||
_UNIT_ACTIVE_STATE_MAX,
|
||||
_UNIT_ACTIVE_STATE_INVALID = -1
|
||||
};
|
||||
|
||||
enum UnitDependency {
|
||||
/* Positive dependencies */
|
||||
UNIT_REQUIRES,
|
||||
@@ -176,5 +188,8 @@ UnitType unit_type_from_string(const char *s) _pure_;
|
||||
const char *unit_load_state_to_string(UnitLoadState i) _const_;
|
||||
UnitLoadState unit_load_state_from_string(const char *s) _pure_;
|
||||
|
||||
const char *unit_active_state_to_string(UnitActiveState i) _const_;
|
||||
UnitActiveState unit_active_state_from_string(const char *s) _pure_;
|
||||
|
||||
const char *unit_dependency_to_string(UnitDependency i) _const_;
|
||||
UnitDependency unit_dependency_from_string(const char *s) _pure_;
|
||||
|
||||
Reference in New Issue
Block a user