unit: Move three helpers to unit.h
This commit is contained in:
@@ -30,18 +30,6 @@
|
||||
#include "user-util.h"
|
||||
#include "web-util.h"
|
||||
|
||||
static bool unit_can_start_refuse_manual(Unit *u) {
|
||||
return unit_can_start(u) && !u->refuse_manual_start;
|
||||
}
|
||||
|
||||
static bool unit_can_stop_refuse_manual(Unit *u) {
|
||||
return unit_can_stop(u) && !u->refuse_manual_stop;
|
||||
}
|
||||
|
||||
static bool unit_can_isolate_refuse_manual(Unit *u) {
|
||||
return unit_can_isolate(u) && !u->refuse_manual_start;
|
||||
}
|
||||
|
||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_collect_mode, collect_mode, CollectMode);
|
||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_load_state, unit_load_state, UnitLoadState);
|
||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_job_mode, job_mode, JobMode);
|
||||
|
||||
@@ -6167,6 +6167,18 @@ int unit_can_clean(Unit *u, ExecCleanMask *ret) {
|
||||
return UNIT_VTABLE(u)->can_clean(u, ret);
|
||||
}
|
||||
|
||||
bool unit_can_start_refuse_manual(Unit *u) {
|
||||
return unit_can_start(u) && !u->refuse_manual_start;
|
||||
}
|
||||
|
||||
bool unit_can_stop_refuse_manual(Unit *u) {
|
||||
return unit_can_stop(u) && !u->refuse_manual_stop;
|
||||
}
|
||||
|
||||
bool unit_can_isolate_refuse_manual(Unit *u) {
|
||||
return unit_can_isolate(u) && !u->refuse_manual_start;
|
||||
}
|
||||
|
||||
bool unit_can_freeze(Unit *u) {
|
||||
assert(u);
|
||||
|
||||
|
||||
@@ -1078,6 +1078,10 @@ void unit_destroy_runtime_data(Unit *u, const ExecContext *context);
|
||||
int unit_clean(Unit *u, ExecCleanMask mask);
|
||||
int unit_can_clean(Unit *u, ExecCleanMask *ret_mask);
|
||||
|
||||
bool unit_can_start_refuse_manual(Unit *u);
|
||||
bool unit_can_stop_refuse_manual(Unit *u);
|
||||
bool unit_can_isolate_refuse_manual(Unit *u);
|
||||
|
||||
bool unit_can_freeze(Unit *u);
|
||||
int unit_freeze(Unit *u);
|
||||
void unit_frozen(Unit *u);
|
||||
|
||||
Reference in New Issue
Block a user