aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librc-depend.h37
-rw-r--r--src/librc.h3
-rw-r--r--src/rc.h30
3 files changed, 47 insertions, 23 deletions
diff --git a/src/librc-depend.h b/src/librc-depend.h
new file mode 100644
index 00000000..a85c6096
--- /dev/null
+++ b/src/librc-depend.h
@@ -0,0 +1,37 @@
+/*
+ * librc-depend.h
+ * Internal header file for dependency structures
+ * Copyright 2007 Gentoo Foundation
+ * Released under the GPLv2
+ */
+
+#ifndef _LIBRC_DEPEND_H
+#define _LIBRC_DEPEND_H
+
+/*! @name Dependency structures
+ * private to librc - rc.h exposes them just a pointers */
+
+/*! Singly linked list of dependency types that list the services the
+ * type is for */
+typedef struct rc_deptype
+{
+ /*! ineed, iuse, iafter, etc */
+ char *type;
+ /*! NULL terminated list of services */
+ char **services;
+ /*! Next dependency type */
+ struct rc_deptype *next;
+} rc_deptype_t;
+
+/*! Singly linked list of services and their dependencies */
+typedef struct rc_depinfo
+{
+ /*! Name of service */
+ char *service;
+ /*! Dependencies */
+ rc_deptype_t *depends;
+ /*! Next service dependency type */
+ struct rc_depinfo *next;
+} rc_depinfo_t;
+
+#endif
diff --git a/src/librc.h b/src/librc.h
index b8f880d3..86f75835 100644
--- a/src/librc.h
+++ b/src/librc.h
@@ -8,6 +8,8 @@
#ifndef _LIBRC_H_
#define _LIBRC_H_
+#define _IN_LIBRC
+
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -41,6 +43,7 @@
#endif
#include "einfo.h"
+#include "librc-depend.h"
#include "rc.h"
#include "rc-misc.h"
#include "strlist.h"
diff --git a/src/rc.h b/src/rc.h
index 4004afad..88adef1e 100644
--- a/src/rc.h
+++ b/src/rc.h
@@ -239,29 +239,13 @@ bool rc_service_daemons_crashed (const char *service);
/*! @name Dependencies
* We analyse each init script and cache the resultant dependency tree.
- * This tree can be accessed using the below structures and functions. */
-/*! Singly linked list of dependency types that list the services the
- * type is for */
-typedef struct rc_deptype
-{
- /*! ineed, iuse, iafter, etc */
- char *type;
- /*! NULL terminated list of services */
- char **services;
- /*! Next dependency type */
- struct rc_deptype *next;
-} rc_deptype_t;
-
-/*! Singly linked list of services and their dependencies */
-typedef struct rc_depinfo
-{
- /*! Name of service */
- char *service;
- /*! Dependencies */
- rc_deptype_t *depends;
- /*! Next service dependency type */
- struct rc_depinfo *next;
-} rc_depinfo_t;
+ * This tree can be accessed using the below functions. */
+
+#ifndef _IN_LIBRC
+/* Handles to internal structures */
+typedef void *rc_deptype_t;
+typedef void *rc_depinfo_t;
+#endif
/*! Update the cached dependency tree if it's older than any init script,
* its configuration file or an external configuration file the init script