X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Funit.h;h=51a8364d63e43b1d4c136cf1dac4a3bbdf6d0e8e;hb=3ecaa09bccd8a59c9f1e06756a1334a162206dc4;hp=a972a313660113e2eef8aa96b71f71be8eb277da;hpb=a34cb32e54ed51125957f69622efef30f42d5fae;p=elogind.git diff --git a/src/core/unit.h b/src/core/unit.h index a972a3136..51a8364d6 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -352,7 +352,7 @@ struct UnitVTable { /* Called whenever a process of this unit sends us a message */ void (*notify_message)(Unit *u, pid_t pid, char **tags); - /* Called whenever a name thus Unit registered for comes or + /* Called whenever a name this Unit registered for comes or * goes away. */ void (*bus_name_owner_change)(Unit *u, const char *name, const char *old_owner, const char *new_owner); @@ -368,6 +368,10 @@ struct UnitVTable { /* Return the set of units that are following each other */ int (*following_set)(Unit *u, Set **s); + /* Invoked each time a unit this unit is triggering changes + * state or gains/loses a job */ + void (*trigger_notify)(Unit *u, Unit *trigger); + /* Called whenever CLOCK_REALTIME made a jump */ void (*time_change)(Unit *u); @@ -417,6 +421,8 @@ extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; /* For casting the various unit types into a unit */ #define UNIT(u) (&(u)->meta) +#define UNIT_TRIGGER(u) ((Unit*) set_first((u)->dependencies[UNIT_TRIGGERS])) + DEFINE_CAST(SOCKET, Socket); DEFINE_CAST(TIMER, Timer); DEFINE_CAST(SERVICE, Service); @@ -540,7 +546,8 @@ char *unit_default_cgroup_path(Unit *u); int unit_following_set(Unit *u, Set **s); -void unit_trigger_on_failure(Unit *u); +void unit_start_on_failure(Unit *u); +void unit_trigger_notify(Unit *u); bool unit_condition_test(Unit *u);