diff options
Diffstat (limited to 'diag.h')
-rw-r--r-- | diag.h | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -24,6 +24,7 @@ #include "cmdline.h" #include "util.h" #include <stdarg.h> +#include <stdbool.h> /** * Shorthand for printing error messages. @@ -33,9 +34,19 @@ void bfs_error(const struct cmdline *cmdline, const char *format, ...); /** * Shorthand for printing warning messages. + * + * @return Whether a warning was printed. */ BFS_FORMATTER(2, 3) -void bfs_warning(const struct cmdline *cmdline, const char *format, ...); +bool bfs_warning(const struct cmdline *cmdline, const char *format, ...); + +/** + * Shorthand for printing debug messages. + * + * @return Whether a debug message was printed. + */ +BFS_FORMATTER(3, 4) +bool bfs_debug(const struct cmdline *cmdline, enum debug_flags flag, const char *format, ...); /** * bfs_error() variant that takes a va_list. @@ -45,7 +56,12 @@ void bfs_verror(const struct cmdline *cmdline, const char *format, va_list args) /** * bfs_warning() variant that takes a va_list. */ -void bfs_vwarning(const struct cmdline *cmdline, const char *format, va_list args); +bool bfs_vwarning(const struct cmdline *cmdline, const char *format, va_list args); + +/** + * bfs_debug() variant that takes a va_list. + */ +bool bfs_vdebug(const struct cmdline *cmdline, enum debug_flags flag, const char *format, va_list args); /** * Print the error message prefix. @@ -55,6 +71,11 @@ void bfs_error_prefix(const struct cmdline *cmdline); /** * Print the warning message prefix. */ -void bfs_warning_prefix(const struct cmdline *cmdline); +bool bfs_warning_prefix(const struct cmdline *cmdline); + +/** + * Print the debug message prefix. + */ +bool bfs_debug_prefix(const struct cmdline *cmdline, enum debug_flags flag); #endif // BFS_DIAG_H |