feat: initial commit of diagd - unified Linux/BSD/macOS/Windows diagnostic tool (TUI + GUI)

This commit is contained in:
2026-09-13 18:29:47 +03:00
commit c3a9569918
165 changed files with 31940 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#include "my_application.h"
#include <string.h>
#include <dlfcn.h>
#include <stdio.h>
int main(int argc, char** argv) {
for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--tui") == 0 || strcmp(argv[i], "-t") == 0) {
// Загрузка функции diagd_run_tui из bundled librust_lib_diagd.so
void* handle = dlopen("lib/librust_lib_diagd.so", RTLD_LAZY);
if (!handle) {
handle = dlopen("librust_lib_diagd.so", RTLD_LAZY);
}
if (handle) {
typedef int (*run_tui_fn)();
run_tui_fn run_tui = (run_tui_fn)dlsym(handle, "diagd_run_tui");
if (run_tui) {
int ret = run_tui();
dlclose(handle);
return ret;
}
}
fprintf(stderr, "Не удалось загрузить модуль TUI из librust_lib_diagd.so: %s\n", dlerror());
return 1;
}
}
g_autoptr(MyApplication) app = my_application_new();
return g_application_run(G_APPLICATION(app), argc, argv);
}