summaryrefslogtreecommitdiff
path: root/include/hybbx/daemon_wrap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hybbx/daemon_wrap.h')
-rw-r--r--include/hybbx/daemon_wrap.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/hybbx/daemon_wrap.h b/include/hybbx/daemon_wrap.h
new file mode 100644
index 0000000..0144e5c
--- /dev/null
+++ b/include/hybbx/daemon_wrap.h
@@ -0,0 +1,36 @@
+#ifndef HYBBX_DAEMON_WRAP_H
+#define HYBBX_DAEMON_WRAP_H
+
+#include "hybbx/types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HYBBX_DAEMON_DEFAULT_SESSION "hybbxd"
+#define HYBBX_DAEMON_WRAP_ENV "HYBBXD_WRAPPED"
+
+typedef struct hybbx_daemon_launch_opts {
+ int foreground;
+ int attach;
+ int use_screen;
+ int use_tmux;
+ char session[32];
+} hybbx_daemon_launch_opts_t;
+
+void hybbx_daemon_launch_opts_defaults(hybbx_daemon_launch_opts_t *opts);
+
+/**
+ * Handle --screen / --tmux / --attach before the service loop.
+ * Spawns or attaches via GNU screen or tmux when requested.
+ * Returns HYBBX_OK to continue a foreground run; otherwise exits the process.
+ */
+hybbx_result_t hybbx_daemon_apply_launch_opts(const hybbx_daemon_launch_opts_t *opts,
+ const char *binary_path,
+ int argc, char **argv);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HYBBX_DAEMON_WRAP_H */
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com