summaryrefslogtreecommitdiffstats
path: root/printf.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-27 12:54:11 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-03-27 12:54:11 -0400
commit954a39edd99cc0a9d426fb48848fd5b1135fa65b (patch)
tree1fcb39b3294982fbb00c3e5f885c3d379048a2c4 /printf.h
parent4846e61080c575a67ebe9805a2332d8dd2b90555 (diff)
downloadbfs-954a39edd99cc0a9d426fb48848fd5b1135fa65b.tar.xz
parse: Highlight command line errors
Diffstat (limited to 'printf.h')
-rw-r--r--printf.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/printf.h b/printf.h
index eac97e6..a8c5f2a 100644
--- a/printf.h
+++ b/printf.h
@@ -1,6 +1,6 @@
/****************************************************************************
* bfs *
- * Copyright (C) 2017-2020 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2017-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. *
@@ -25,6 +25,7 @@
struct BFTW;
struct bfs_ctx;
+struct bfs_expr;
/**
* A printf command, the result of parsing a single format string.
@@ -36,12 +37,14 @@ struct bfs_printf;
*
* @param ctx
* The bfs context.
+ * @param expr
+ * The expression to fill in.
* @param format
* The format string to parse.
* @return
- * The parsed printf command, or NULL on failure.
+ * 0 on success, -1 on failure.
*/
-struct bfs_printf *bfs_printf_parse(const struct bfs_ctx *ctx, const char *format);
+int bfs_printf_parse(const struct bfs_ctx *ctx, struct bfs_expr *expr, const char *format);
/**
* Evaluate a parsed format string.