/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* parenthesis.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/09/13 20:38:29 by charles #+# #+# */ /* Updated: 2020/09/13 20:40:19 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "eval.h" int wrapped_eval(void *void_param) { t_fork_param_args *param; param = void_param; return (eval(param->fds, param->env, param->path, param->ast, NULL)); } int eval_parenthesis(int fds[2], t_env env, t_path path, t_ast *ast) { int status; t_fork_param_args param; if ((status = redir_extract(&ast->redirs, env, fds)) != 0) return (status); ast->tag ^= AST_PARENT; param.fds[0] = fds[0]; param.fds[1] = fds[1]; param.env = env; param.path = path; param.ast = ast->parent_ast; return (fork_wrap(fds, ¶m, wrapped_eval, NULL)); }