summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2008-05-20 18:02:51 -0700
committerDan Nicholson <dbn.lists@gmail.com>2008-05-20 18:02:51 -0700
commit11920a5b64435f869aa920f33c135b7920a4df99 (patch)
treee3b7e1e1ea64c8be03c5495ddd98fe794fa0d4ec /lib
parent7bb1fab3c564e937de4d6e81196984d87df8ddc6 (diff)
Move rcpair definitions into separate rc internal header
The rcpair struct and the static instances rcdirs and rcsdirs will be reused, so they're moved into a separate internal header.
Diffstat (limited to 'lib')
-rw-r--r--lib/active.c27
-rw-r--r--lib/rcint.h30
2 files changed, 31 insertions, 26 deletions
diff --git a/lib/active.c b/lib/active.c
index df4144f..88845ab 100644
--- a/lib/active.c
+++ b/lib/active.c
@@ -14,11 +14,7 @@
#include <string.h>
#include "initd.h"
#include "str.h"
-
-struct rcpair {
- char *dir;
- initd_rc_t rc;
-};
+#include "rcint.h"
static bool active_verbose = false;
static bool read_dir_symlinks(initd_list_t *ilp, const struct rcpair *rcp);
@@ -29,27 +25,6 @@ static void set_active_from_symlink(initd_list_t *ilp,
static void add_active_link(const initd_t *ip, const char *link,
const struct rcpair *rcp, initd_key_t key);
-static struct rcpair rcsdirs[] = {
- { "../rcS.d", RC_S },
- { "../rcs.d", RC_S },
- { "../rcSI.d", RC_S },
- { "../rcsi.d", RC_S },
- { "../rcSYSINIT.d", RC_S },
- { "../rcsysinit.d", RC_S },
- { NULL, 0 }
-};
-
-static struct rcpair rcdirs[] = {
- { "../rc0.d", RC_0 },
- { "../rc1.d", RC_1 },
- { "../rc2.d", RC_2 },
- { "../rc3.d", RC_3 },
- { "../rc4.d", RC_4 },
- { "../rc5.d", RC_5 },
- { "../rc6.d", RC_6 },
- { NULL, 0 }
-};
-
void initd_list_set_actives(initd_list_t *ilp, const char *dir)
{
char *cwd;
diff --git a/lib/rcint.h b/lib/rcint.h
new file mode 100644
index 0000000..e0c06b8
--- /dev/null
+++ b/lib/rcint.h
@@ -0,0 +1,30 @@
+#ifndef _rcint_h_
+#define _rcint_h_
+
+struct rcpair {
+ char *dir;
+ initd_rc_t rc;
+};
+
+static struct rcpair rcsdirs[] = {
+ { "../rcS.d", RC_S },
+ { "../rcs.d", RC_S },
+ { "../rcSI.d", RC_S },
+ { "../rcsi.d", RC_S },
+ { "../rcSYSINIT.d", RC_S },
+ { "../rcsysinit.d", RC_S },
+ { NULL, 0 }
+};
+
+static struct rcpair rcdirs[] = {
+ { "../rc0.d", RC_0 },
+ { "../rc1.d", RC_1 },
+ { "../rc2.d", RC_2 },
+ { "../rc3.d", RC_3 },
+ { "../rc4.d", RC_4 },
+ { "../rc5.d", RC_5 },
+ { "../rc6.d", RC_6 },
+ { NULL, 0 }
+};
+
+#endif /* _rcint_h_ */