summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/s6/servicedir.h29
-rw-r--r--src/libs6/deps-lib/s61
-rw-r--r--src/libs6/s6_servicedir_file_list.c20
3 files changed, 50 insertions, 0 deletions
diff --git a/src/include/s6/servicedir.h b/src/include/s6/servicedir.h
new file mode 100644
index 0000000..b575370
--- /dev/null
+++ b/src/include/s6/servicedir.h
@@ -0,0 +1,29 @@
+/* ISC license. */
+
+#ifndef S6_SERVICEDIR_H
+#define S6_SERVICEDIR_H
+
+#include <stdint.h>
+
+#define S6_SERVICEDIR_FILE_MAXLEN 16
+
+#define S6_FILETYPE_NORMAL 0
+#define S6_FILETYPE_EMPTY 1
+#define S6_FILETYPE_UINT 2
+#define S6_FILETYPE_DIR 3
+
+#define S6_SVFILE_EXECUTABLE 0x01
+#define S6_SVFILE_MANDATORY 0x02
+#define S6_SVFILE_ATOMIC 0x04
+
+typedef struct s6_servicedir_desc_s s6_servicedir_desc, *s6_servicedir_desc_ref ;
+struct s6_servicedir_desc_s
+{
+ char const *name ;
+ uint8_t type : 3 ;
+ uint8_t options : 5 ;
+} ;
+
+extern s6_servicedir_desc const *const s6_servicedir_file_list ;
+
+#endif
diff --git a/src/libs6/deps-lib/s6 b/src/libs6/deps-lib/s6
index 17b6dc4..2fa977c 100644
--- a/src/libs6/deps-lib/s6
+++ b/src/libs6/deps-lib/s6
@@ -31,6 +31,7 @@ s6_dtally_pack.o
s6_dtally_unpack.o
s6_dtally_read.o
s6_dtally_write.o
+s6_servicedir_file_list.o
s6_svc_ok.o
s6_svc_write.o
s6_svc_writectl.o
diff --git a/src/libs6/s6_servicedir_file_list.c b/src/libs6/s6_servicedir_file_list.c
new file mode 100644
index 0000000..bf55d0d
--- /dev/null
+++ b/src/libs6/s6_servicedir_file_list.c
@@ -0,0 +1,20 @@
+/* ISC license. */
+
+#include <s6/servicedir.h>
+
+static s6_servicedir_desc const s6_servicedir_file_list_[] =
+{
+ { .name = "finish", .type = S6_FILETYPE_NORMAL, .options = S6_SVFILE_EXECUTABLE | S6_SVFILE_ATOMIC },
+ { .name = "run", .type = S6_FILETYPE_NORMAL, .options = S6_SVFILE_EXECUTABLE | S6_SVFILE_MANDATORY | S6_SVFILE_ATOMIC },
+ { .name = "notification-fd", .type = S6_FILETYPE_UINT, .options = 0 },
+ { .name = "lock-fd", .type = S6_FILETYPE_UINT, .options = 0 },
+ { .name = "timeout-kill", .type = S6_FILETYPE_UINT, .options = 0 },
+ { .name = "timeout-finish", .type = S6_FILETYPE_UINT, .options = 0 },
+ { .name = "max-death-tally", .type = S6_FILETYPE_UINT, .options = 0 },
+ { .name = "down-signal", .type = S6_FILETYPE_NORMAL, .options = 0 },
+ { .name = "data", .type = S6_FILETYPE_DIR, .options = 0 },
+ { .name = "env", .type = S6_FILETYPE_DIR, .options = 0 },
+ { .name = 0, .options = 0 }
+} ;
+
+s6_servicedir_desc const *const s6_servicedir_file_list = s6_servicedir_file_list_ ;