From 19528c3cab1020196bd6a033dd47871e087f8886 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 6 Oct 2020 13:12:09 -0400 Subject: expr, eval: Clean up header dependencies --- eval.c | 1 + eval.h | 23 +++++++++++++++++++++-- expr.h | 18 +----------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/eval.c b/eval.c index 246a60c..e3806d8 100644 --- a/eval.c +++ b/eval.c @@ -25,6 +25,7 @@ #include "diag.h" #include "dstring.h" #include "exec.h" +#include "expr.h" #include "fsade.h" #include "mtab.h" #include "printf.h" 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 + +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. diff --git a/expr.h b/expr.h index 4bb2e84..2462861 100644 --- a/expr.h +++ b/expr.h @@ -22,6 +22,7 @@ #define BFS_EXPR_H #include "color.h" +#include "eval.h" #include "exec.h" #include "printf.h" #include "stat.h" @@ -36,23 +37,6 @@ */ 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); - /** * Possible types of numeric comparison. */ -- cgit v1.2.3