diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-14 16:07:19 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-06-14 16:07:19 +0200 |
| commit | 47fff4418d3a83ae214429f395232c3536ff03c4 (patch) | |
| tree | 8dd1021d3ae899b80cf052ae42a40c4bc965c654 /include | |
| parent | 26ddbd7146f65a2cf100713f422a9ab5b1890620 (diff) | |
| download | minishell-47fff4418d3a83ae214429f395232c3536ff03c4.tar.gz minishell-47fff4418d3a83ae214429f395232c3536ff03c4.tar.bz2 minishell-47fff4418d3a83ae214429f395232c3536ff03c4.zip | |
Added eval cmd and error handling draft, Updated preprocessing for list
Diffstat (limited to 'include')
| -rw-r--r-- | include/eval.h | 27 | ||||
| -rw-r--r-- | include/minishell.h | 8 |
2 files changed, 22 insertions, 13 deletions
diff --git a/include/eval.h b/include/eval.h index 8fbbb1c..b90e8b6 100644 --- a/include/eval.h +++ b/include/eval.h @@ -6,7 +6,7 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:05:30 by charles #+# #+# */ -/* Updated: 2020/06/14 10:33:54 by charles ### ########.fr */ +/* Updated: 2020/06/14 12:52:45 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,7 +27,6 @@ typedef struct { - int p[2]; t_path path; t_env env; } t_eval_state; @@ -54,8 +53,9 @@ typedef struct { char *exec_path; char **argv; - char **envp; -} t_fork_param_execve; + t_env env; + t_builtin_func builtin; +} t_fork_param_cmd; /* ** eval.c @@ -71,11 +71,20 @@ 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); -/* -** pipe.c -*/ +enum e_error +{ + ERROR_AMBIGUOUS_REDIR, + ERROR_OPEN, + ERROR_CMD_NOT_FOUND, + ERROR_SYNTAX, +}; -// 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]); +typedef struct +{ + enum e_error id; + int status; + char *msg; // if NULL call strerror + // char *basename; +} t_error; #endif diff --git a/include/minishell.h b/include/minishell.h index 2afbed9..07c2fa1 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */ -/* Updated: 2020/06/12 11:57:36 by charles ### ########.fr */ +/* Updated: 2020/06/14 16:03:25 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -95,8 +95,8 @@ struct s_builtin_entry t_builtin_func func; }; -int builtin_dispatch_run(char **argv, t_env env); -bool builtin_check_exec_name(char *exec_name); +t_builtin_func builtin_search_func(char *name); + int builtin_echo(char **argv, t_env env); int builtin_cd(char **argv, t_env env); int builtin_pwd(char **argv, t_env env); @@ -109,6 +109,6 @@ int builtin_exit(char **argv, t_env env); ** preprocess.c */ -char **preprocess(t_ftvec *argv, t_env env); +char **preprocess(t_ftlst *tokens, t_env env); #endif |
