X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=unit.h;h=585b090b59aae7a095c621dbdd76a8eca59716c6;hb=ea4309869e75497ba6a97c540646cb66a157a4d9;hp=2433cc7d7cf7e1ca6afcf436d63e898a6e2f358c;hpb=ef734fd6c2ec4e5602bbfe2a0d26dcf39c14d2bf;p=elogind.git diff --git a/unit.h b/unit.h index 2433cc7d7..585b090b5 100644 --- a/unit.h +++ b/unit.h @@ -41,7 +41,8 @@ enum UnitLoadState { UNIT_STUB, UNIT_LOADED, UNIT_FAILED, - _UNIT_LOAD_STATE_MAX + _UNIT_LOAD_STATE_MAX, + _UNIT_LOAD_STATE_INVALID = -1 }; enum UnitActiveState { @@ -50,7 +51,8 @@ enum UnitActiveState { UNIT_INACTIVE, UNIT_ACTIVATING, UNIT_DEACTIVATING, - _UNIT_ACTIVE_STATE_MAX + _UNIT_ACTIVE_STATE_MAX, + _UNIT_ACTIVE_STATE_INVALID = -1 }; static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) { @@ -111,6 +113,12 @@ struct Meta { bool in_load_queue:1; + /* If we go down, pull down everything that depends on us, too */ + bool recursive_stop; + + /* Garbage collect us we nobody wants or requires us anymore */ + bool stop_when_unneeded; + usec_t active_enter_timestamp; usec_t active_exit_timestamp; @@ -254,4 +262,18 @@ int set_unit_path(const char *p); char *unit_name_escape_path(const char *prefix, const char *path, const char *suffix); +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); + +const char *unit_active_state_to_string(UnitActiveState i); +UnitActiveState unit_active_state_from_string(const char *s); + +const char *unit_dependency_to_string(UnitDependency i); +UnitDependency unit_dependency_from_string(const char *s); + +char *unit_dbus_path(Unit *u); + #endif