summaryrefslogtreecommitdiffstats
path: root/diag.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-26 19:42:55 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-03-27 12:53:15 -0400
commit4846e61080c575a67ebe9805a2332d8dd2b90555 (patch)
treec76a7408dd534f5dd12a087687c739bd9f2a50bd /diag.h
parentc2139e2e03cbcee9a1ae03956b1f06d3a9c269b0 (diff)
downloadbfs-4846e61080c575a67ebe9805a2332d8dd2b90555.tar.xz
diag: New functions for highlighting command line arguments
Diffstat (limited to 'diag.h')
-rw-r--r--diag.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/diag.h b/diag.h
index aa5e1c7..39129cc 100644
--- a/diag.h
+++ b/diag.h
@@ -1,6 +1,6 @@
/****************************************************************************
* bfs *
- * Copyright (C) 2019 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2019-2022 Tavian Barnes <tavianator@tavianator.com> *
* *
* Permission to use, copy, modify, and/or distribute this software for any *
* purpose with or without fee is hereby granted. *
@@ -26,6 +26,8 @@
#include <stdarg.h>
#include <stdbool.h>
+struct bfs_expr;
+
/**
* Like perror(), but decorated like bfs_error().
*/
@@ -83,4 +85,24 @@ bool bfs_warning_prefix(const struct bfs_ctx *ctx);
*/
bool bfs_debug_prefix(const struct bfs_ctx *ctx, enum debug_flags flag);
+/**
+ * Highlight parts of the command line in an error message.
+ */
+void bfs_argv_error(const struct bfs_ctx *ctx, const bool *args);
+
+/**
+ * Highlight parts of an expression in an error message.
+ */
+void bfs_expr_error(const struct bfs_ctx *ctx, const struct bfs_expr *expr);
+
+/**
+ * Highlight parts of the command line in a warning message.
+ */
+bool bfs_argv_warning(const struct bfs_ctx *ctx, const bool *args);
+
+/**
+ * Highlight parts of an expression in a warning message.
+ */
+bool bfs_expr_warning(const struct bfs_ctx *ctx, const struct bfs_expr *expr);
+
#endif // BFS_DIAG_H