aboutsummaryrefslogtreecommitdiff
path: root/include/eval.h
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-06-18 14:05:42 +0200
committernass1pro <nass1pro@gmail.com>2020-06-18 14:05:42 +0200
commit1e53dcdbd4f94a11a6d23687bc518fdd8aee0bd9 (patch)
tree64c9fdfb2f9d055404d72160e9d0f679809e7426 /include/eval.h
parent70459a3ab97b13df9bf829e29ed91becfba1ea03 (diff)
parent52bc3c1a6035dae4e45015c48a8c65681a31512a (diff)
downloadminishell-1e53dcdbd4f94a11a6d23687bc518fdd8aee0bd9.tar.gz
minishell-1e53dcdbd4f94a11a6d23687bc518fdd8aee0bd9.tar.bz2
minishell-1e53dcdbd4f94a11a6d23687bc518fdd8aee0bd9.zip
Merge branch 'master' into parse_cmd
Diffstat (limited to 'include/eval.h')
-rw-r--r--include/eval.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/include/eval.h b/include/eval.h
index bde0cd7..60d6f23 100644
--- a/include/eval.h
+++ b/include/eval.h
@@ -6,7 +6,7 @@
/* By: charles <charles@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:05:30 by charles #+# #+# */
-/* Updated: 2020/06/17 15:49:49 by nahaddac ### ########.fr */
+/* Updated: 2020/06/18 13:38:53 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,6 +19,7 @@
*/
# include "minishell.h"
+# include "lexer.h"
# include "ast.h"
/*
@@ -47,7 +48,7 @@ typedef struct
t_op *op;
int fd_in;
int fd_out;
-} t_fork_param_line;
+} t_fork_param_op;
typedef struct
{
@@ -57,21 +58,16 @@ typedef struct
t_builtin_func builtin;
} t_fork_param_cmd;
-#define MS_NO_FD -2
+# define MS_NO_FD -2
+# define FDS_WRITE 1
+# define FDS_READ 0
/*
-** eval.c
+** op.c
*/
-int eval(int fd_in, int fd_out, t_eval_state *state, t_ast *ast);
-
-/*
-** exec.c
-*/
-
-bool exec_is_path(char *path_str);
-bool exec_is_valid(char *exec_path);
-char *exec_search_path(t_path path, char *path_var, char *exec_name);
+int eval_op(int fds[2], t_env env, t_path path, t_op *op);
+int eval(int fds[2], t_env env, t_path path, t_ast *ast);
enum e_error
{
@@ -99,12 +95,21 @@ void error_eval_put(enum e_error id, char *unexpected);
** cmd.c
*/
-int eval_cmd(t_env env, t_path path, t_ast *ast);
+int fork_wrap(int fds[2], void *passed, int (*wrapped)(void *param));
+int eval_cmd(int fds[2], t_env env, t_path path, t_ast *ast);
/*
** redir.c
*/
-bool redir_extract(t_ftlst *redirs, t_env env, int *fd_in, int *fd_out);
+bool redir_extract(t_ftlst *redirs, t_env env, int fds[2]);
+
+/*
+** exec.c
+*/
+
+bool exec_is_path(char *exec_name);
+bool exec_is_valid(char *exec_path);
+char *exec_search_path(t_path path, char *path_var, char *exec_name);
#endif