summaryrefslogtreecommitdiffstats
path: root/eval.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-10-06 13:12:09 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-10-06 13:12:09 -0400
commit19528c3cab1020196bd6a033dd47871e087f8886 (patch)
treebc6dd53bf5e0a8612f9d284fb92606bc513724e1 /eval.h
parentff53e4e4778109389192494af3bb5dbfcdeb50f0 (diff)
downloadbfs-19528c3cab1020196bd6a033dd47871e087f8886.tar.xz
expr, eval: Clean up header dependencies
Diffstat (limited to 'eval.h')
-rw-r--r--eval.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/eval.h b/eval.h
index 9a1885b..2a43e09 100644
--- a/eval.h
+++ b/eval.h
@@ -22,8 +22,27 @@
#ifndef BFS_EVAL_H
#define BFS_EVAL_H
-#include "ctx.h"
-#include "expr.h"
+#include <stdbool.h>
+
+struct bfs_ctx;
+struct expr;
+
+/**
+ * Ephemeral state for evaluating an expression.
+ */
+struct eval_state;
+
+/**
+ * Expression evaluation function.
+ *
+ * @param expr
+ * The current expression.
+ * @param state
+ * The current evaluation state.
+ * @return
+ * The result of the test.
+ */
+typedef bool eval_fn(const struct expr *expr, struct eval_state *state);
/**
* Evaluate the command line.