aboutsummaryrefslogtreecommitdiffstats
path: root/src/s6/s6-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/s6/s6-internal.h')
-rw-r--r--src/s6/s6-internal.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/s6/s6-internal.h b/src/s6/s6-internal.h
new file mode 100644
index 0000000..216d666
--- /dev/null
+++ b/src/s6/s6-internal.h
@@ -0,0 +1,48 @@
+/* ISC license. */
+
+#ifndef S6_INTERNAL_H
+#define S6_INTERNAL_H
+
+#include <stdlib.h>
+
+#include <skalibs/functypes.h>
+#include <s6-frontend/config.h>
+
+
+ /* util */
+
+extern int keycmp (void const *, void const *) ;
+#define BSEARCH(type, key, array) bsearch(key, (array), sizeof(array)/sizeof(type), sizeof(type), &keycmp)
+
+
+ /* help */
+
+extern int help (char const *const *) ;
+
+
+ /* version */
+
+extern int version (char const *const *) ;
+
+
+ /* main */
+
+struct global_s
+{
+ unsigned int verbosity ;
+} ;
+#define GLOBAL_ZERO \
+{ \
+ .verbosity = 1, \
+}
+
+extern struct global_s *g ;
+
+struct command_s
+{
+ char const *s ;
+ main_func_ref f ;
+} ;
+#define COMMAND_ZERO { .s = 0, .f = 0 }
+
+#endif