From: Davin McCall Date: Wed, 30 Dec 2015 00:08:39 +0000 (+0000) Subject: Move service event types into service-constants.h X-Git-Tag: v0.01~88 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b3da820814b4157fc1b24aff06c19aca749ad731;p=oweals%2Fdinit.git Move service event types into service-constants.h --- diff --git a/service-constants.h b/service-constants.h index e0b8a90..0836106 100644 --- a/service-constants.h +++ b/service-constants.h @@ -9,8 +9,6 @@ enum class ServiceState { STOPPING // service script is stopping and will stop. }; - - /* Service types */ enum class ServiceType { DUMMY, // dummy service, used to detect cyclice dependencies @@ -21,4 +19,14 @@ enum class ServiceType { INTERNAL // internal service, runs no external process }; +/* Service events */ +enum class ServiceEvent { + STARTED, // Service was started (reached STARTED state) + STOPPED, // Service was stopped (reached STOPPED state) + FAILEDSTART, // Service failed to start (possibly due to dependency failing) + STARTCANCELLED, // Service was set to be started but a stop was requested + STOPCANCELLED // Service was set to be stopped but a start was requested +}; + + #endif diff --git a/service-listener.h b/service-listener.h index b443602..82fc354 100644 --- a/service-listener.h +++ b/service-listener.h @@ -1,15 +1,9 @@ #ifndef SERVICE_LISTENER_H #define SERVICE_LISTENER_H -class ServiceRecord; +#include -enum class ServiceEvent { - STARTED, // Service was started (reached STARTED state) - STOPPED, // Service was stopped (reached STOPPED state) - FAILEDSTART, // Service failed to start (possibly due to dependency failing) - STARTCANCELLED, // Service was set to be started but a stop was requested - STOPCANCELLED // Service was set to be stopped but a start was requested -}; +class ServiceRecord; // Interface for listening to services class ServiceListener