Integrate shared C transport with desktop and Android frontends, add radio probes and detailed Windows diagnostics, and fix GUI build dependencies and early configuration startup errors.
24 lines
684 B
C
24 lines
684 B
C
#include "config_error.h"
|
|
#include <errno.h>
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
static __thread char config_errors[4096];
|
|
|
|
void config_error_clear(void) { config_errors[0] = '\0'; }
|
|
const char *config_error_text(void) { return config_errors; }
|
|
|
|
void config_error_append(const char *format, ...) {
|
|
const int saved_errno = errno;
|
|
size_t used = strlen(config_errors);
|
|
if (used < sizeof(config_errors) - 2) {
|
|
if (used) config_errors[used++] = '\n';
|
|
va_list args;
|
|
va_start(args, format);
|
|
vsnprintf(config_errors + used, sizeof(config_errors) - used, format, args);
|
|
va_end(args);
|
|
}
|
|
errno = saved_errno;
|
|
}
|