Added plat_break() for raising breakpoints and warning() and log_warning() to raise visible non-fatal warnings to the user.

This commit is contained in:
OBattler
2025-03-22 00:49:20 +01:00
parent 6df6eae482
commit 63f106a0fd
6 changed files with 108 additions and 5 deletions

View File

@@ -294,6 +294,31 @@ log_fatal(void *priv, const char *fmt, ...)
exit(-1);
}
void
log_warning(void *priv, const char *fmt, ...)
{
log_t *log = (log_t *) priv;
char temp[1024];
char fmt2[1024];
va_list ap;
if (log == NULL)
return;
if (log->cyclic_buff != NULL) {
for (int i = 0; i < LOG_SIZE_BUFFER_CYCLIC_LINES; i++)
if (log->cyclic_buff[i] != NULL)
free(log->cyclic_buff[i]);
free(log->cyclic_buff);
}
va_start(ap, fmt);
log_copy(log, fmt2, fmt, 1024);
vsprintf(temp, fmt2, ap);
warning_ex(fmt2, ap);
va_end(ap);
}
static void *
log_open_common(const char *dev_name, const int cyclic)
{