aboutsummaryrefslogtreecommitdiff
path: root/include/eval.h
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-09-13 09:17:35 +0200
committernass1pro <nass1pro@gmail.com>2020-09-13 09:17:35 +0200
commit935d1ed5ad3d20dd901a4c3cfbb8453626460f18 (patch)
tree247b7059873131f047337dd468ab00a3be2a9d41 /include/eval.h
parent5146be239d6ab71db602ec7b6826b6484aa0f178 (diff)
parent65006d0c14d3efa647b3c866ab54bdb1749fa31d (diff)
downloadminishell-935d1ed5ad3d20dd901a4c3cfbb8453626460f18.tar.gz
minishell-935d1ed5ad3d20dd901a4c3cfbb8453626460f18.tar.bz2
minishell-935d1ed5ad3d20dd901a4c3cfbb8453626460f18.zip
Merge branch 'master' of https://github.com/ouaisbrefbams/minishell
Diffstat (limited to 'include/eval.h')
-rw-r--r--include/eval.h46
1 files changed, 20 insertions, 26 deletions
diff --git a/include/eval.h b/include/eval.h
index a23b249..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/09 17:27:21 by charles ### ########.fr */
+/* Updated: 2020/09/12 12:28:36 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -24,60 +24,54 @@
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
{
char *exec_path;
char **argv;
t_env env;
- t_env env_local;
t_builtin_entry *builtin;
} t_fork_param_cmd;
-# define MS_NO_FD -2
-# define FDS_WRITE 1
-# define FDS_READ 0
+# define FD_NONE -2
+# 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
*/
-bool 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);
-
-/*
-** variable.c
-*/
-
-bool variable_extract(t_tok_lst **argv, t_env env, t_env env_local);
+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