From: Davin McCall Date: Tue, 29 Dec 2015 09:17:54 +0000 (+0000) Subject: Split service constants (state/event enumerations) into a separate X-Git-Tag: v0.01~92 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a87a7524d22c546da8fbcd4d62d54868d8c32f29;p=oweals%2Fdinit.git Split service constants (state/event enumerations) into a separate include file. --- diff --git a/service-constants.h b/service-constants.h new file mode 100644 index 0000000..e0b8a90 --- /dev/null +++ b/service-constants.h @@ -0,0 +1,24 @@ +#ifndef SERVICE_CONSTANTS_H +#define SERVICE_CONSTANTS_H + +/* Service states */ +enum class ServiceState { + STOPPED, // service is not running. + STARTING, // service is starting, and will start (or fail to start) in time. + STARTED, // service is running, + STOPPING // service script is stopping and will stop. +}; + + + +/* Service types */ +enum class ServiceType { + DUMMY, // dummy service, used to detect cyclice dependencies + PROCESS, // service runs as a process, and can be stopped by + // sending the process a signal (SIGTERM) + SCRIPTED, // service requires an external command to start, + // and a second command to stop + INTERNAL // internal service, runs no external process +}; + +#endif diff --git a/service.h b/service.h index 7c5f956..0e7ebf2 100644 --- a/service.h +++ b/service.h @@ -9,6 +9,7 @@ #include "ev.h" #include "control.h" #include "service-listener.h" +#include "service-constants.h" /* * Possible service states @@ -33,25 +34,6 @@ * A process service is in the STOPPING state when it has been signalled to stop, and is * in the STARTING state when waiting for dependencies to start. */ -enum class ServiceState { - STOPPED, // service is not running. - STARTING, // service is starting, and will start (or fail to start) in time. - STARTED, // service is running, - STOPPING // service script is stopping and will stop. -}; - - - -/* Service types */ -enum class ServiceType { - DUMMY, // dummy service, used to detect cyclice dependencies - PROCESS, // service runs as a process, and can be stopped by - // sending the process a signal (SIGTERM) - SCRIPTED, // service requires an external command to start, - // and a second command to stop - INTERNAL // internal service, runs no external process -}; - struct OnstartFlags { bool release_console : 1;