-static const char * const rcnd_table[] = {
- "/rc0.d", SPECIAL_RUNLEVEL0_TARGET,
- "/rc1.d", SPECIAL_RUNLEVEL1_TARGET,
- "/rc2.d", SPECIAL_RUNLEVEL2_TARGET,
- "/rc3.d", SPECIAL_RUNLEVEL3_TARGET,
- "/rc4.d", SPECIAL_RUNLEVEL4_TARGET,
- "/rc5.d", SPECIAL_RUNLEVEL5_TARGET,
- "/rc6.d", SPECIAL_RUNLEVEL6_TARGET,
- "/boot.d", SPECIAL_BASIC_TARGET
+typedef enum RunlevelType {
+ RUNLEVEL_UP,
+ RUNLEVEL_DOWN,
+ RUNLEVEL_BASIC
+} RunlevelType;
+
+static const struct {
+ const char *path;
+ const char *target;
+ const RunlevelType type;
+} rcnd_table[] = {
+ /* Standard SysV runlevels */
+ { "rc0.d", SPECIAL_RUNLEVEL0_TARGET, RUNLEVEL_DOWN },
+ { "rc1.d", SPECIAL_RUNLEVEL1_TARGET, RUNLEVEL_UP },
+ { "rc2.d", SPECIAL_RUNLEVEL2_TARGET, RUNLEVEL_UP },
+ { "rc3.d", SPECIAL_RUNLEVEL3_TARGET, RUNLEVEL_UP },
+ { "rc4.d", SPECIAL_RUNLEVEL4_TARGET, RUNLEVEL_UP },
+ { "rc5.d", SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP },
+ { "rc6.d", SPECIAL_RUNLEVEL6_TARGET, RUNLEVEL_DOWN },
+
+ /* SuSE style boot.d */
+ { "boot.d", SPECIAL_BASIC_TARGET, RUNLEVEL_BASIC },
+
+ /* Debian style rcS.d */
+ { "rcS.d", SPECIAL_BASIC_TARGET, RUNLEVEL_BASIC },