summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-06-04 20:48:10 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-06-04 20:48:10 +0000
commit4b31caa9cdaef67c70bc7fb43963ba68b7bf5bb1 (patch)
treeb9d634a9199d7f69ae4e1f35d88edac63d04abcf /src/include
downloads6-rc-4b31caa9cdaef67c70bc7fb43963ba68b7bf5bb1.tar.xz
Initial commit
Diffstat (limited to 'src/include')
-rw-r--r--src/include/s6-rc/s6rc-constants.h14
-rw-r--r--src/include/s6-rc/s6rc-db.h69
-rw-r--r--src/include/s6-rc/s6rc-utils.h10
-rw-r--r--src/include/s6-rc/s6rc.h10
4 files changed, 103 insertions, 0 deletions
diff --git a/src/include/s6-rc/s6rc-constants.h b/src/include/s6-rc/s6rc-constants.h
new file mode 100644
index 0000000..50217c9
--- /dev/null
+++ b/src/include/s6-rc/s6rc-constants.h
@@ -0,0 +1,14 @@
+/* ISC license. */
+
+#ifndef S6RC_CONSTANTS_H
+#define S6RC_CONSTANTS_H
+
+#define S6RC_COMPILED_BASE "/etc/s6-rc/compiled"
+#define S6RC_LIVE_BASE "/s6/s6-rc"
+
+#define S6RC_COMPILED_DIR_LEN 32
+
+#define S6RC_ONESHOT_RUNNER "s6rc-oneshot-runner"
+#define S6RC_ONESHOT_RUNNER_LEN (sizeof S6RC_ONESHOT_RUNNER - 1)
+
+#endif
diff --git a/src/include/s6-rc/s6rc-db.h b/src/include/s6-rc/s6rc-db.h
new file mode 100644
index 0000000..bc475c7
--- /dev/null
+++ b/src/include/s6-rc/s6rc-db.h
@@ -0,0 +1,69 @@
+/* ISC license. */
+
+#ifndef S6RC_DB_H
+#define S6RC_DB_H
+
+#include <skalibs/uint32.h>
+#include <skalibs/buffer.h>
+
+#define S6RC_DB_BANNER_START "s6rc-db: start\n"
+#define S6RC_DB_BANNER_START_LEN (sizeof(S6RC_DB_BANNER_START) - 1)
+#define S6RC_DB_BANNER_END "\ns6rc-db: end\n"
+#define S6RC_DB_BANNER_END_LEN (sizeof(S6RC_DB_BANNER_END) - 1)
+
+
+typedef struct s6rc_oneshot_s s6rc_oneshot_t, *s6rc_oneshot_t_ref ;
+struct s6rc_oneshot_s
+{
+ uint32 argc[2] ;
+ uint32 argv[2] ;
+} ;
+
+typedef struct s6rc_longrun_s s6rc_longrun_t, *s6rc_longrun_t_ref ;
+struct s6rc_longrun_s
+{
+ uint32 servicedir ;
+} ;
+
+typedef union s6rc_longshot_u s6rc_longshot_t, *s6rc_longshot_t_ref ;
+union s6rc_longshot_u
+{
+ s6rc_oneshot_t oneshot ;
+ s6rc_longrun_t longrun ;
+} ;
+
+typedef struct s6rc_service_s s6rc_service_t, *s6rc_service_t_ref ;
+struct s6rc_service_s
+{
+ uint32 name ;
+ uint32 flags ;
+ uint32 deps[2] ;
+ uint32 ndeps[2] ;
+ uint32 timeout[2] ;
+ s6rc_longshot_t x ;
+ unsigned char type : 1 ;
+} ;
+
+typedef struct s6rc_db_s s6rc_db_t, *s6rc_db_t_ref ;
+struct s6rc_db_s
+{
+ s6rc_service_t *services ;
+ unsigned int nshort ;
+ unsigned int nlong ;
+ unsigned int stringlen ;
+ unsigned int nargvs ;
+ unsigned int ndeps ;
+ char *string ;
+ char **argvs ;
+ uint32 *deps ;
+} ;
+
+extern int s6rc_db_read_uint32 (buffer *, uint32 *) ;
+
+extern int s6rc_db_read_sizes (int, s6rc_db_t *) ;
+extern int s6rc_db_read (int, s6rc_db_t *) ;
+
+extern unsigned int s6rc_db_check_depcycles (s6rc_db_t const *, int, unsigned int *) ;
+extern int s6rc_db_check_revdeps (s6rc_db_t const *) ;
+
+#endif
diff --git a/src/include/s6-rc/s6rc-utils.h b/src/include/s6-rc/s6rc-utils.h
new file mode 100644
index 0000000..992d865
--- /dev/null
+++ b/src/include/s6-rc/s6rc-utils.h
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#ifndef S6RC_UTILS_H
+#define S6RC_UTILS_H
+
+#include <s6-rc/s6rc-db.h>
+
+extern void s6rc_graph_closure (s6rc_db_t const *, unsigned char *, unsigned int, int) ;
+
+#endif
diff --git a/src/include/s6-rc/s6rc.h b/src/include/s6-rc/s6rc.h
new file mode 100644
index 0000000..098f38b
--- /dev/null
+++ b/src/include/s6-rc/s6rc.h
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#ifndef S6RC_H
+#define S6RC_H
+
+#include <s6-rc/s6rc-constants.h>
+#include <s6-rc/s6rc-db.h>
+#include <s6-rc/s6rc-utils.h>
+
+#endif