From 4b31caa9cdaef67c70bc7fb43963ba68b7bf5bb1 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 4 Jun 2015 20:48:10 +0000 Subject: Initial commit --- src/include/s6-rc/s6rc-constants.h | 14 ++++++++ src/include/s6-rc/s6rc-db.h | 69 ++++++++++++++++++++++++++++++++++++++ src/include/s6-rc/s6rc-utils.h | 10 ++++++ src/include/s6-rc/s6rc.h | 10 ++++++ 4 files changed, 103 insertions(+) create mode 100644 src/include/s6-rc/s6rc-constants.h create mode 100644 src/include/s6-rc/s6rc-db.h create mode 100644 src/include/s6-rc/s6rc-utils.h create mode 100644 src/include/s6-rc/s6rc.h (limited to 'src/include') 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 +#include + +#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 + +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 +#include +#include + +#endif -- cgit v1.2.3