Files
zdwm/tests/core/main.c
Zedhugh Chen 2fc4b33359 style: 更新 .clang-format 规则并重新格式化所有源文件
- 重构模块使用新的代码风格
- 老代码 (src 目录下的代码) 继续使用之前的代码风格

通过在需要不同代码风格的目录下放对应 .clang-format 配置文件实现
2026-04-14 01:52:53 +08:00

44 lines
944 B
C

#include "base/log.h"
#include "config/runtime_config.h"
#include "core/backend.h"
#include "core/runtime.h"
static void bootstrap(runtime_t *runtime) {
backend_t *backend = backend_create(nullptr);
backend_detect_t *detect = backend_detect(backend);
if (!backend || !detect || detect->output_count == 0) {
fatal("backend detect failed");
}
runtime_init_desc_t desc = {
.backend = backend,
.outputs = detect->outputs,
.output_count = detect->output_count,
};
if (!runtime_config_load(nullptr, &desc)) {
fatal("failed to build runtime inputs");
}
backend = nullptr;
bool inited = runtime_init(runtime, &desc);
runtime_init_desc_cleanup(&desc);
backend_detect_destroy(detect);
if (!inited) {
fatal("zdwm runtime init failed");
}
};
int main(void) {
runtime_t runtime = {0};
bootstrap(&runtime);
runtime_run(&runtime);
runtime_shutdown(&runtime);
return 0;
}