diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/ast.h | 12 | ||||
| -rw-r--r-- | include/debug_tools.h | 11 | ||||
| -rw-r--r-- | include/env.h | 3 | ||||
| -rw-r--r-- | include/minishell.h | 15 | ||||
| -rw-r--r-- | include/token.h | 3 |
5 files changed, 33 insertions, 11 deletions
diff --git a/include/ast.h b/include/ast.h index 0335473..0dede50 100644 --- a/include/ast.h +++ b/include/ast.h @@ -3,15 +3,17 @@ /* ::: :::::::: */ /* ast.h :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ +/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/27 11:48:27 by dkaiser #+# #+# */ -/* Updated: 2025/01/16 18:26:30 by dkaiser ### ########.fr */ +/* Updated: 2025/01/18 19:28:51 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ -#include "debug_tools.h" -#include "stdlib.h" +#ifndef AST_H +# define AST_H +# include "debug_tools.h" +# include "stdlib.h" enum e_node_type { @@ -67,3 +69,5 @@ t_node *new_cmd_node(char **args, t_redirection redirs[2], t_node *new_string_node(char *string); void free_node(t_node *node); + +#endif
\ No newline at end of file diff --git a/include/debug_tools.h b/include/debug_tools.h index 4a7ff10..6c4bc29 100644 --- a/include/debug_tools.h +++ b/include/debug_tools.h @@ -3,15 +3,17 @@ /* ::: :::::::: */ /* debug_tools.h :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ +/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/24 18:34:37 by dkaiser #+# #+# */ -/* Updated: 2024/06/28 15:05:12 by dkaiser ### ########.fr */ +/* Updated: 2025/01/19 21:08:15 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef DEBUG_TOOLS_H # define DEBUG_TOOLS_H +# include <stdarg.h> +# include "debug_tools.h" # include "libft.h" @@ -22,4 +24,9 @@ void dbg(char *str); void panic(char *msg); + + +void dbg2(const char *format, ...); + + #endif diff --git a/include/env.h b/include/env.h index 0c45aef..3fc83b7 100644 --- a/include/env.h +++ b/include/env.h @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/08/08 16:53:39 by dkaiser #+# #+# */ -/* Updated: 2025/01/14 16:50:55 by chuhlig ### ########.fr */ +/* Updated: 2025/01/18 18:43:07 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,5 +37,6 @@ int cd(t_env **env, char **args); int ft_env(t_env *env); int builtin_exit(char **args, t_env **env); t_env *env_new(char *name); +t_env *check_existing(t_env *env, char *av); #endif
\ No newline at end of file diff --git a/include/minishell.h b/include/minishell.h index ee42c79..7a573e8 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/22 17:14:49 by dkaiser #+# #+# */ -/* Updated: 2025/01/16 18:38:44 by dkaiser ### ########.fr */ +/* Updated: 2025/01/18 19:30:43 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,11 +41,20 @@ void print_ast(t_node *ast); int eval(t_node *node, t_env **env); char *get_cmd_path(char *cmd, t_env *env, int *return_code); int execute_cmd(t_cmd *cmd, t_env **env); -char *format_string(char *str, t_env *env); +char *format_string(char *str, t_env *env, int is_literal); int set_return_code(int return_code, t_env **env); int handle_redirections(t_redirection *redirs); void *error(int err_code, char *err_text, int exit_code, int *ret_code); char *read_heredoc(char *delimiter); -void create_files(t_list *files); +int handle_input_redirection(t_redirection *redir); +int handle_output_redirection(t_redirection *redir); +int handle_redirections(t_redirection *redirs); +int handle_pipe_parent(int p[2], t_node *node, t_env **env); +int handle_pipe_child(int p[2], t_node *node, + t_env **env, int in_fd); +int open_file(char *path, int flags, int mode); +int eval_rec(t_node *node, t_env **env, int in_fd); +void create_files(t_list *files); + #endif diff --git a/include/token.h b/include/token.h index 54a65f2..993a408 100644 --- a/include/token.h +++ b/include/token.h @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/27 13:27:18 by dkaiser #+# #+# */ -/* Updated: 2024/08/29 15:26:23 by dkaiser ### ########.fr */ +/* Updated: 2025/01/20 12:37:59 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -49,5 +49,6 @@ void free_token_and_connect(t_token *token); void free_tokens(t_token *tokens); void tokenizer(char *s, t_token **token_list, char quote_check); +void print_token(t_token *token); #endif |
