From 78dc50a2bce3c6e31405437189e2990d8fc720ac Mon Sep 17 00:00:00 2001 From: Christopher Uhlig Date: Mon, 13 Jan 2025 11:06:54 +0100 Subject: here --- include/env.h | 18 +++++++++++++++++- include/minishell.h | 16 +++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/env.h b/include/env.h index 5a65333..d38ed29 100644 --- a/include/env.h +++ b/include/env.h @@ -6,10 +6,15 @@ /* By: chuhlig +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/08/08 16:53:39 by dkaiser #+# #+# */ -/* Updated: 2024/10/17 15:37:32 by chuhlig ### ########.fr */ +/* Updated: 2024/12/24 16:21:50 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ +#ifndef ENV_H +# define ENV_H +# include "libft.h" +# include + typedef struct s_env { char *name; @@ -19,4 +24,15 @@ typedef struct s_env void getenvlst(t_env **env, char **en); void free_envlst(t_env **env); +char *env_get(t_env *env, char *name); +char **env_to_strlst(t_env *env); +void update_oldpwd(t_env **env); +void update_pwd(t_env **env); +int unset(char **av, t_env **env); +int export(char **av, t_env **env); +int echo(char **av); +int pwd(t_env *env); +int cd(t_env **env, char **args); +int ft_env(t_env *env); +#endif \ No newline at end of file diff --git a/include/minishell.h b/include/minishell.h index 6997b15..028a4fc 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* minishell.h :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: dkaiser +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/22 17:14:49 by dkaiser #+# #+# */ -/* Updated: 2024/08/11 12:22:07 by dkaiser ### ########.fr */ +/* Updated: 2025/01/11 16:05:11 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,11 +29,17 @@ int init(void); int init_signal_handling(void); -void repl(const char *prompt); +void repl(const char *prompt, t_env **env); -t_list *parse(t_token *tokens); -t_node *parse_cmd(t_token *tokens); +t_list *parse(t_token *tokens, t_env **env); +t_node *parse_cmd(t_token *tokens, t_env **env); t_redirection *collect_redirs(t_token **tokens); void print_ast(t_node *ast); +int eval(t_node *node, t_env **env); +char *get_cmd_path(char *cmd, t_env *env); +int execute_cmd(t_cmd *cmd, t_env **env); +char *format_string(char *str, t_env *env); + + #endif -- cgit v1.2.3