27#include "xtc_export.h"
38typedef struct xtc_app xtc_app_t;
40typedef struct xtc_app_opts {
63#define XTC_APP_OPTS_DEFAULT { \
64 .size = sizeof(xtc_app_opts_t), \
68 .no_tuning_check = 0, \
106#define XTC_APP_SHUTDOWN_MSG "$xtc_shutdown"
107#define XTC_APP_SHUTDOWN_REASON 1
115typedef struct xtc_app_drain_report {
121 uint64_t forced_mask;
122 uint64_t survivor_mask;
126#define XTC_APP_DRAIN_REPORT_INIT { .size = sizeof(xtc_app_drain_report_t) }
142XTC_API
int xtc_app_create(
const xtc_app_opts_t *opts, xtc_app_t **out);
143XTC_API
void xtc_app_destroy(xtc_app_t *app);
146XTC_API
int xtc_app_start(xtc_app_t *app,
152XTC_API
int xtc_app_run(xtc_app_t *app);
157XTC_API
int xtc_app_stop(xtc_app_t *app);
160XTC_API
int xtc_app_shutdown(xtc_app_t *app, int64_t drain_ns,
176XTC_API
int xtc_app_drain_on_signal(xtc_app_t *app, int64_t drain_ns,
181XTC_API
int xtc_app_is_shutdown_msg(
const void *msg,
size_t len);
183XTC_API xtc_loop_t *xtc_app_loop(
const xtc_app_t *app);
188XTC_API xtc_exec_t *xtc_app_exec(
const xtc_app_t *app);
190XTC_API xtc_reg_t *xtc_app_registry(
const xtc_app_t *app);