From e5393671a265e1c301c6c303f21f938c4cf9ca75 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 2 Apr 2020 15:50:13 +0200 Subject: Evaluation pipe frame (not tested) --- include/eval.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/eval.h') diff --git a/include/eval.h b/include/eval.h index 31f729b..31f79c2 100644 --- a/include/eval.h +++ b/include/eval.h @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:05:30 by charles #+# #+# */ -/* Updated: 2020/04/01 17:53:26 by charles ### ########.fr */ +/* Updated: 2020/04/02 15:38:11 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,11 +43,17 @@ typedef struct s_eval_status int status; } t_eval_status; +typedef struct +{ + int pipe_in[2]; + int pipe_out[2]; +} t_io_frame; + /* ** eval.c */ -int eval(t_eval_state *state, t_ast *ast); +int eval(t_io_frame *frame, t_eval_state *state, t_ast *ast); /* ** exec.c @@ -63,5 +69,6 @@ char *exec_search_path(t_path path, char *path_var, char *exec_name); int pipe_setup_parent(t_cmd *cmd, int pipe_in[2], int pipe_out[2]); int pipe_setup_child(int pipe_in[2], int pipe_out[2]); +int io_frame_init(t_io_frame *frame); #endif -- cgit From 9fabc25a980550afc6337fd729632462f2680daa Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 12 Apr 2020 18:36:17 +0200 Subject: Removing data name in ast union, io_frame, root line ast tag --- include/eval.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'include/eval.h') diff --git a/include/eval.h b/include/eval.h index 31f79c2..fc149b2 100644 --- a/include/eval.h +++ b/include/eval.h @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:05:30 by charles #+# #+# */ -/* Updated: 2020/04/02 15:38:11 by charles ### ########.fr */ +/* Updated: 2020/05/04 11:58:16 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,8 +27,7 @@ typedef struct { - int pipe_in[2]; - int pipe_out[2]; + int p[2]; t_path path; t_env env; } t_eval_state; @@ -45,15 +44,24 @@ typedef struct s_eval_status typedef struct { - int pipe_in[2]; - int pipe_out[2]; -} t_io_frame; + t_eval_state *state; + t_line *line; + int fd_in; + int fd_out; +} t_fork_param_line; + +typedef struct +{ + char *exec_path; + char **argv; + char **envp; +} t_fork_param_execve; /* ** eval.c */ -int eval(t_io_frame *frame, t_eval_state *state, t_ast *ast); +int eval(int fd_in, int fd_out, t_eval_state *state, t_ast *ast); /* ** exec.c @@ -69,6 +77,5 @@ char *exec_search_path(t_path path, char *path_var, char *exec_name); int pipe_setup_parent(t_cmd *cmd, int pipe_in[2], int pipe_out[2]); int pipe_setup_child(int pipe_in[2], int pipe_out[2]); -int io_frame_init(t_io_frame *frame); #endif -- cgit