diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -477,13 +477,16 @@ void warning(char *format, ...) va_end(args); } +static uint8_t output_enabled = 1; void info_message(char *format, ...) { va_list args; va_start(args, format); #ifndef _WIN32 if (headless || (isatty(STDOUT_FILENO) && isatty(STDIN_FILENO))) { - info_printf(format, args); + if (output_enabled) { + info_printf(format, args); + } } else { #endif int32_t size = strlen(format) * 2; @@ -503,7 +506,9 @@ void info_message(char *format, ...) va_start(args, format); vsnprintf(buf, actual, format, args); } - info_puts(buf); + if (output_enabled) { + info_puts(buf); + } render_infobox("BlastEm Info", buf); free(buf); #ifndef _WIN32 @@ -512,6 +517,20 @@ void info_message(char *format, ...) va_end(args); } +void debug_message(char *format, ...) +{ + va_list args; + va_start(args, format); + if (output_enabled) { + info_printf(format, args); + } +} + +void disable_stdout_messages(void) +{ + output_enabled = 0; +} + #ifdef _WIN32 #include <windows.h> #include <shlobj.h> |