diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-03-26 19:42:55 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-03-27 12:53:15 -0400 |
commit | 4846e61080c575a67ebe9805a2332d8dd2b90555 (patch) | |
tree | c76a7408dd534f5dd12a087687c739bd9f2a50bd /diag.h | |
parent | c2139e2e03cbcee9a1ae03956b1f06d3a9c269b0 (diff) | |
download | bfs-4846e61080c575a67ebe9805a2332d8dd2b90555.tar.xz |
diag: New functions for highlighting command line arguments
Diffstat (limited to 'diag.h')
-rw-r--r-- | diag.h | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -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 |