aboutsummaryrefslogtreecommitdiff
path: root/include/eval.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-31 21:41:33 +0200
committerCharles <sircharlesaze@gmail.com>2020-03-31 21:41:33 +0200
commitb15ab562d74b5111ac7c9bd6e0ec185435902472 (patch)
tree664a55a24d7e36a5f56bf1ce7b0ea96751e0cda0 /include/eval.h
parent808d1499f5708ad4eda3612416e62efe6fdff021 (diff)
downloadminishell-b15ab562d74b5111ac7c9bd6e0ec185435902472.tar.gz
minishell-b15ab562d74b5111ac7c9bd6e0ec185435902472.tar.bz2
minishell-b15ab562d74b5111ac7c9bd6e0ec185435902472.zip
Removing ms_ prefix, Removing junk
Diffstat (limited to 'include/eval.h')
-rw-r--r--include/eval.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/eval.h b/include/eval.h
new file mode 100644
index 0000000..ec04ff5
--- /dev/null
+++ b/include/eval.h
@@ -0,0 +1,44 @@
+#ifndef MS_EVAL_H
+# define MS_EVAL_H
+
+/**
+** \file eval.h
+** \brief Evaluation module
+*/
+
+# include "minishell.h"
+# include "ast.h"
+
+/**
+** \brief Evaluation state struct
+*/
+
+typedef struct
+{
+ int status;
+ int in_pipe[2]; // need stack pipe
+ int out_pipe[2];
+ t_path path;
+ t_env env;
+} t_eval_state;
+
+/**
+** \brief Evaluation status struct
+*/
+
+typedef struct
+{
+ char *err;
+ int status;
+} t_eval_status;
+
+
+/**
+** \brief Evaluate an AST
+** \param state State of the evaluation
+** \param ast Abstract syntax tree to evaluate
+*/
+
+int eval(t_eval_state *state, t_ast *ast);
+
+#endif