aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-12 17:12:41 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-12 17:12:41 +0200
commit65006d0c14d3efa647b3c866ab54bdb1749fa31d (patch)
tree716de58438e96bde6a5553a8dd2a44620f529617 /include
parent9446bb78646bef4e3449a59a9e01118b025402bf (diff)
downloadminishell-65006d0c14d3efa647b3c866ab54bdb1749fa31d.tar.gz
minishell-65006d0c14d3efa647b3c866ab54bdb1749fa31d.tar.bz2
minishell-65006d0c14d3efa647b3c866ab54bdb1749fa31d.zip
Added concurrent pipeline (not working with minishell_test for some obscure reason)
Diffstat (limited to 'include')
-rw-r--r--include/eval.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/include/eval.h b/include/eval.h
index b799c26..89f05ef 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/09/11 19:10:30 by charles ### ########.fr */
+/* Updated: 2020/09/12 12:28:36 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -24,11 +24,11 @@
typedef struct
{
- t_path path;
- t_env env;
- t_ast *ast;
- int fds[2];
-} t_fork_param_parent;
+ t_path path;
+ t_env env;
+ t_ast *ast;
+ int fds[2];
+} t_fork_param_args;
typedef struct
{
@@ -42,35 +42,36 @@ typedef struct
# define FD_WRITE 1
# define FD_READ 0
-extern pid_t g_child_pid;
+extern pid_t g_child_pid;
/*
** op.c
*/
-int eval_op(int fds[2], t_env env, t_path path, t_ast *ast);
-int eval(int fds[2], t_env env, t_path path, t_ast *ast);
+int eval_op(int fds[2], t_env env, t_path path, t_ast *ast);
+int eval(int fds[2], t_env env, t_path path, t_ast *ast);
+int eval_forked(int fds[2], t_env env, t_path path, t_ast *ast, pid_t *child_pid);
/*
** cmd.c
*/
-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);
-t_ftlst *split_token(t_ftlst **lst, enum e_tok);
+int fork_wrap(int fds[2], void *passed, int (*wrapped)(void *param), pid_t *child_pid);
+int fork_wrap_wait(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
*/
-int redir_extract(t_tok_lst **redirs, t_env env, int fds[2]);
+int redir_extract(t_tok_lst **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);
+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